This repository was archived by the owner on Feb 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
Update to handle Socket implements Stream<Uint8List> #65
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A recent change in the Dart SDK updated `Socket` to implement `Stream<Uint8List>` rather than `Stream<List<int>>`. This forwards compatible change calls `StreamTransformer.bind()` rather than `Stream.transform()`, thus putting the stream in a covariant position and allowing for the transition to `Uint8List`. dart-lang/sdk#36900
kevmoo
approved these changes
Jul 9, 2019
I don't have permission to merge or publish 😕 |
Going to land #66 then will publish |
natebosch
reviewed
Jul 9, 2019
@@ -709,7 +709,7 @@ class WebSocketImpl extends Stream with _ServiceObject implements StreamSink { | |||
_readyState = WebSocket.OPEN; | |||
|
|||
var transformer = _WebSocketProtocolTransformer(_serverSide); | |||
_subscription = stream.transform(transformer).listen((data) { | |||
_subscription = transformer.bind(stream).listen((data) { |
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.
Is this going to be necessary long term or only during the transition?
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.
- If we decide to follow-up with a change to make
Encoding
extendCodec<String, Uint8List>
, then this will only be needed during a transition period. however, such a change would be very breaking in its own right, so we'd need to evaluate whether it was warranted. - If decide not to follow-up with such a change, then either this change (using
StreamTransformer.bind()
rather thanStream.transform()
) or usingStream.cast<List<int>>.transform()
will be necessary going forward.
I tend to prefer the option of updating Encoding
, but then again, I tend towards clean APIs at the expense of breakages / churn. I haven't yet opened that decision up for discussion - waiting for the dust to settle with the existing round of breakages 🙂
algodave
added a commit
to algonauti/dart-active-storage
that referenced
this pull request
Jul 12, 2019
mosuem
pushed a commit
to dart-lang/http
that referenced
this pull request
Dec 11, 2024
…b_socket_channel#65) A recent change in the Dart SDK updated `Socket` to implement `Stream<Uint8List>` rather than `Stream<List<int>>`. This forwards compatible change calls `StreamTransformer.bind()` rather than `Stream.transform()`, thus putting the stream in a covariant position and allowing for the transition to `Uint8List`. dart-lang/sdk#36900
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A recent change in the Dart SDK updated
Socket
toimplement
Stream<Uint8List>
rather thanStream<List<int>>
.This forwards compatible change calls
StreamTransformer.bind()
rather than
Stream.transform()
, thus putting the stream in acovariant position and allowing for the transition to
Uint8List
.dart-lang/sdk#36900