This package exposes the
StreamChannel interface, which represents a two-way
communication channel. Each
StreamChannel exposes a
Stream for receiving
data and a
StreamSink for sending it.
StreamChannel helps abstract communication logic away from the underlying
protocol. For example, the
test package re-uses its test suite
communication protocol for both WebSocket connections to browser suites and
Isolate connections to VM tests.
This package also contains utilities for dealing with
StreamChannels and with
two-way communications in general. For documentation of these utilities, see
the API docs.
StreamChannel.transform(). This previously inverted the generic parameters, so it only really worked with transformers where both generic types were identical.
Disconnector.disconnect()now returns a future that completes when all the inner
StreamSink.close()futures have completed.
new StreamChannel.withCloseGuarantee() to provide the specific guarantee
that closing the sink causes the stream to close before it emits any more
events. This is the only guarantee that isn't automatically preserved when
transforming a channel.
StreamChannelTransformers provided by the
stream_channel package now
properly provide the guarantee that closing the sink causes the stream to
close before it emits any more events
StreamChannel.cast(), which soundly coerces the generic type of a
StreamChannelTransformer.typed(), which soundly coerces the generic type
of a transformer.
IsolateChannel slightly more efficient.
MultiChannel follow the stream channel rules.
Disconnector, a transformer that allows the caller to disconnect the transformed channel.
new StreamChannel.withGuarantees(), which creates a channel with extra
wrapping to ensure that it obeys the stream channel guarantees.
StreamChannelController, which can be used to create custom
StreamChannel.changeSink() to support
changing only the stream or only the sink of a channel.
Be more explicit about
JsonDocumentTransformer's error-handling behavior.
MultiChannel's constructor to take a
StreamChannel. This is technically a breaking change, but since 1.0.0 was only released an hour ago, we're treating it as a bug fix.
Add this to your package's pubspec.yaml file:
dependencies: stream_channel: "^1.6.2"
You can install packages from the command line:
$ pub get
Alternatively, your editor might support 'pub get'. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|1.6.2||Sep 22, 2017||Go to the documentation of stream_channel 1.6.2||Download stream_channel 1.6.2 archive|
|1.6.1||Jan 25, 2017||Go to the documentation of stream_channel 1.6.1||Download stream_channel 1.6.1 archive|
|1.6.0||Jan 19, 2017||Go to the documentation of stream_channel 1.6.0||Download stream_channel 1.6.0 archive|
|1.5.0||Jun 6, 2016||Go to the documentation of stream_channel 1.5.0||Download stream_channel 1.5.0 archive|
|1.4.0||May 10, 2016||Go to the documentation of stream_channel 1.4.0||Download stream_channel 1.4.0 archive|
|1.3.2||May 10, 2016||Go to the documentation of stream_channel 1.3.2||Download stream_channel 1.3.2 archive|
|1.3.1||Feb 10, 2016||Go to the documentation of stream_channel 1.3.1||Download stream_channel 1.3.1 archive|
|1.3.0||Feb 9, 2016||Go to the documentation of stream_channel 1.3.0||Download stream_channel 1.3.0 archive|
|1.2.0||Feb 9, 2016||Go to the documentation of stream_channel 1.2.0||Download stream_channel 1.2.0 archive|
|1.1.1||Feb 2, 2016||Go to the documentation of stream_channel 1.1.1||Download stream_channel 1.1.1 archive|