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

Add DataStream.Trailer for finalizing streams #940

Merged
merged 4 commits into from
Jan 10, 2025
Merged

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Jan 10, 2025

Instead of sending Chunk.complete with every data stream chunk, it makes more sense to have a dedicated closing message.

This allows us to communicate more insights on reasons why the stream stopped (esp. if it stopped unexpectedly) and also allows us to finalize some data of the stream info, e.g. the endTime for a transcription.

Copy link

changeset-bot bot commented Jan 10, 2025

🦋 Changeset detected

Latest commit: 2e4bcf5

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "github.com/livekit/protocol" specified in the `fixed` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@lukasIO lukasIO requested review from bcherry and davidzhao January 10, 2025 15:30
Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the closing message required? do we have mechanisms of retrying in case it's not delivered?

@lukasIO
Copy link
Contributor Author

lukasIO commented Jan 10, 2025

closing message is required for the stream to close, we do not have mechanisms today to retry it.

This isn't worse as before, the complete: true message had the same restrictions, we can just be more explicit about things with a dedicated message for closing

@lukasIO lukasIO merged commit 5b4142c into main Jan 10, 2025
1 check passed
@lukasIO lukasIO deleted the lukas/stream-trailer branch January 10, 2025 16:43
@github-actions github-actions bot mentioned this pull request Jan 10, 2025
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