Channel<T> class abstract

A channel is an object used to send and receive messages between tasks. Messages from senders are queued until an interested receiver request a message, and registered receiver is queued until a message is available.

Every channel has an underlying buffer which defines the buffering strategy (Buffers.fixed, Buffers.dropping and Buffers.sliding)

Implementers

Constructors

Channel()

Properties

hashCode int
The hash code for this object.
no setterinherited
onClose Callback?
Invoked before closing the channel. Then all the awating takers will be invoked with End
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Closes the channel which means no more puts will be allowed. All pending takers will be invoked with End.
flush(TakeCallback<List<T>> callback) → void
Used to extract all buffered messages from the channel. The flush is resolved using the following rules
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(T message) → void
Used to put message on the buffer. The put will be handled using the following rules
take(TakeCallback<T> callback, [PatternMatcher<T> matcher]) → void
Used to register a taker. The take is resolved using the following rules
toString() String
A string representation of this object.
inherited

Operators

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