Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[breaking] Refactor Python user API #495

Merged
merged 1 commit into from
Sep 28, 2023
Merged

[breaking] Refactor Python user API #495

merged 1 commit into from
Sep 28, 2023

Conversation

cbornet
Copy link
Member

@cbornet cbornet commented Sep 27, 2023

This is a breaking change of the API but it really simplifies usage for the user.
It also brings the possibility to return the process/write results asynchronously.

Changes (see api.py and util.py)

  • Sink::write takes a single record (previously a list)
  • Remove Sink::set_commit_callback and CommitCallback : now a successful return of the write method commits the record. It's also possible to return a Future and the commit will happen when the future completes.
  • Processor::process takes a single record (identical to SingleRecordProcessor)
  • Processor::process can return a list of records or a future that will complete with the list of records.
  • Remove SingleRecordProcessor

@eolivelli
Copy link
Member

Please rebase onto the main branch the other branch has been merged

@cbornet cbornet changed the title [DO NOT MERGE][breaking] Refactor Python user API [breaking] Refactor Python user API Sep 27, 2023
@cbornet cbornet marked this pull request as ready for review September 27, 2023 21:42
@eolivelli eolivelli merged commit 2f601f8 into main Sep 28, 2023
8 checks passed
@eolivelli eolivelli deleted the python-api-refacto branch September 28, 2023 09:04
benfrank241 pushed a commit to vectorize-io/langstream that referenced this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants