-
Notifications
You must be signed in to change notification settings - Fork 187
Expose DataChannel buffer status events #654
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
Conversation
🦋 Changeset detectedLatest commit: ca77ee6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks good!
Wanted to think through the API a bit more though. Is there any way for this to be easier to use? The current design is event -> push. which follows the data channel usage pretty closely. However, this seems kind of tricky to write programs for. Primarily because we'd leave the user to coordinate event handler code with their data source. (it's also difficult to know how much data to write at the same time)
Options to make the API easier would most likely just move the buffer to a different place in the code. There are two different scenarios I can think of:
|
Yeah that's fair. for 2. the current API should still work ok I guess. Agreed we shouldn't cause everything to be buffered and keeping the native data channel notifications is the low-friction path. |
(will revert the changes to example.ts, but helps with testing)