Channel<T> class Null safety

Golang like channel to send/buffer/receive data

Implementers

Constructors

Channel()
factory
Channel.from(Iterable<T> values)
factory
Channel.fromStream(Stream<T> stream)
factory

Properties

hashCode int
The hash code for this object.
read-onlyinherited
isClosed bool
Is the channel closed?
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

asStream() Stream<ChannelEvent<T?>>
Reads the channel as Stream.
close() → void
Closes the channel so that no more values can be sent to it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
pipe(Stream<T> stream) Future<void>
Pipes the content of stream into the channel
receive() Future<ChannelEvent<T>>
Reads one value from the channel. Returns immediately if a value is available in the channel. If the channel is empty, a future is returned that resolves with the value when a new value is available.
send(T value) FutureOr<void>
Sends one value to the channel
sendAll(Iterable<T> values) FutureOr<void>
Sends all values to the channel
toString() String
A string representation of this object.
inherited
tryReceive({T? onClose}) Future<T?>
Reads one value from the channel. Returns null or onClose if the channel has no value and it is closed.

Operators

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