StreamChannelTransformer<S, T> class

A StreamChannelTransformer transforms the events being passed to and emitted by a StreamChannel.

This works on the same principle as StreamTransformer and StreamSinkTransformer. Each transformer defines a bind method that takes in the original StreamChannel and returns the transformed version.

Transformers must be able to have bind called multiple times. If a subclass implements bind explicitly, it should be sure that the returned stream follows the second stream channel guarantee: closing the sink causes the stream to close before it emits any more events. This guarantee is invalidated when an asynchronous gap is added between the original stream's event dispatch and the returned stream's, for example by transforming it with a StreamTransformer. The guarantee can be easily preserved using StreamChannel.withCloseGuarantee.

Implementers

Constructors

StreamChannelTransformer(StreamTransformer<T, S> _streamTransformer, StreamSinkTransformer<S, T> _sinkTransformer)
Creates a StreamChannelTransformer from existing stream and sink transformers.
const
StreamChannelTransformer.fromCodec(Codec<S, T> codec)
Creates a StreamChannelTransformer from a codec's encoder and decoder.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bind(StreamChannel<T> channel) StreamChannel<S>
Transforms the events sent to and emitted by channel.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited