ChannelCommunication<In, Out, Response> class
- Inheritance
- Implemented types
-
- Sink<
In>
- Sink<
- Available extensions
Constructors
-
ChannelCommunication.new(Channel<
In, dynamic, dynamic> input, Channel<dynamic, Out, Response> output, {ChannelAction<In, Out, Response> ? action})
Properties
-
action
→ ChannelAction<
In, Out, Response> ? -
Adds functionality to the
.on(callback)
method, given the data returned by the consumer of the channel.finalinherited -
first
→ Future<
Out> -
The first element of this stream.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
input
→ Channel<
In, dynamic, dynamic> -
final
- isBroadcast → bool
-
Whether this stream is a broadcast stream.
no setterinherited
-
isEmpty
→ Future<
bool> -
Whether this stream contains any elements.
no setterinherited
-
last
→ Future<
Out> -
The last element of this stream.
no setterinherited
-
length
→ Future<
int> -
The number of elements in this stream.
no setterinherited
-
output
→ Channel<
dynamic, Out, Response> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
single
→ Future<
Out> -
The single element of this stream.
no setterinherited
-
sink
↔ Sink<
In> -
getter/setter pairinherited-setter
-
stream
↔ Stream<
Out> -
getter/setter pairinherited-setter
Methods
-
add(
In data) → void -
Adds
data
to the sink.inherited -
any(
bool test(Out element)) → Future< bool> -
Checks whether
test
accepts any element provided by this stream.inherited -
asBroadcastStream(
{void onListen(StreamSubscription< Out> subscription)?, void onCancel(StreamSubscription<Out> subscription)?}) → Channel<In, Out, Response> -
Returns a multi-subscription stream that produces the same events as this.
inherited
-
asyncExpand<
E> (Stream< E> ? convert(Out event)) → Stream<E> -
Transforms each element into a sequence of asynchronous events.
inherited
-
asyncMap<
E> (FutureOr< E> convert(Out event)) → Stream<E> -
Creates a new stream with each data event of this stream asynchronously
mapped to a new event.
inherited
-
cast<
R> () → Stream< R> -
Adapt this stream to be a
Stream<R>
.inherited -
close(
) → void -
Closes the sink.
inherited
-
contains(
Object? needle) → Future< bool> -
Returns whether
needle
occurs in the elements provided by this stream.inherited -
distinct(
[bool equals(Out previous, Out next)?]) → Channel< In, Out, Response> -
Skips data events if they are equal to the previous data event.
inherited
-
drain<
E> ([E? futureValue]) → Future< E> -
Discards all data on this stream, but signals when it is done or an error
occurred.
inherited
-
elementAt(
int index) → Future< Out> -
Returns the value of the
index
th data event of this stream.inherited -
every(
bool test(Out element)) → Future< bool> -
Checks whether
test
accepts all elements provided by this stream.inherited -
expand<
S> (Iterable< S> convert(Out element)) → Stream<S> -
Transforms each element of this stream into a sequence of elements.
inherited
-
firstWhere(
bool test(Out element), {Out orElse()?}) → Future< Out> -
Finds the first element of this stream matching
test
.inherited -
fold<
S> (S initialValue, S combine(S previous, Out element)) → Future< S> -
Combines a sequence of values by repeatedly applying
combine
.inherited -
forEach(
void action(Out element)) → Future< void> -
Executes
action
on each element of this stream.inherited -
handleError(
Function onError, {bool test(dynamic error)?}) → Channel< In, Out, Response> -
Creates a wrapper Stream that intercepts some errors from this stream.
inherited
-
join(
[String separator = ""]) → Future< String> -
Combines the string representation of elements into a single string.
inherited
-
lastWhere(
bool test(Out element), {Out orElse()?}) → Future< Out> -
Finds the last element in this stream matching
test
.inherited -
listen(
void onData(Out event)?, {Function? onError, void onDone()?, bool? cancelOnError}) → StreamSubscription< Out> -
Adds a subscription to this stream.
inherited
-
map<
S> (S convert(Out event)) → Stream< S> -
Transforms each element of this stream into a new stream event.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on(
ChannelActionCallback< Out, Response> callback) → StreamSubscription<Out> -
Listen to the output stream, and execute a callback when data is received.
inherited
-
once(
ChannelActionCallback< Out, Response> callback) → StreamSubscription<Out> -
Same as
.on(callback)
, but only listen to the first data received.inherited -
pipe(
StreamConsumer< Out> streamConsumer) → Future -
Pipes the events of this stream into
streamConsumer
.inherited -
reduce(
Out combine(Out previous, Out element)) → Future< Out> -
Combines a sequence of values by repeatedly applying
combine
.inherited -
singleWhere(
bool test(Out element), {Out orElse()?}) → Future< Out> -
Finds the single element in this stream matching
test
.inherited -
skip(
int count) → Channel< In, Out, Response> -
Skips the first
count
data events from this stream.inherited -
skipWhile(
bool test(Out element)) → Channel< In, Out, Response> -
Skip data events from this stream while they are matched by
test
.inherited -
take(
int count) → Channel< In, Out, Response> -
Provides at most the first
count
data events of this stream.inherited -
takeWhile(
bool test(Out element)) → Channel< In, Out, Response> -
Forwards data events while
test
is successful.inherited -
timeout(
Duration timeLimit, {void onTimeout(EventSink< Out> sink)?}) → Channel<In, Out, Response> -
Creates a new stream with the same events as this stream.
inherited
-
toChannel(
) → Channel< In, Out, void> -
Available on RawChannel<
In, Out> , provided by the RawChannelToChannel extension -
toList(
) → Future< List< Out> > -
Collects all elements of this stream in a List.
inherited
-
toSet(
) → Future< Set< Out> > -
Collects the data of this stream in a Set.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transform<
S> (StreamTransformer< Out, S> streamTransformer) → Stream<S> -
Applies
streamTransformer
to this stream.inherited -
using(
Stream< Out> stream) → Channel<In, Out, Response> -
Instantiate a new channel, using the current channel as the input.
inherited
-
where(
bool test(Out event)) → Channel< In, Out, Response> -
Creates a new stream from this stream that discards some elements.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited