Attaches a reactive value to this channel.
Attaches a reactive value to this channel.
This call has no effect if the reactive is already sealed.
the reactive to attach
this reactive channel, to chain attach calls or call seal
Seals this channel.
Seals this channel.
Once a seal is successful, no more attach
calls will succeed.
Composes this channel with a custom mapping function for the input events.
Composes this channel with a custom mapping function for the input events.
Events from reactives passed to this channel are mapped inside their isolates.
type of the events the new channel will accept
maps events in the resulting channel to events of the original channel
the new channel accepting events of type S
(channel: StringAdd).self
(channel: StringFormat).self
(channel: ArrowAssoc[Channel[T]]).x
(Since version 2.10.0) Use leftOfArrow
instead
(channel: Ensuring[Channel[T]]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
The
Channel
is the writing end of an isolate.Every isolate is associated with a channel. Unlike reactive values or signals, channels can be used in a thread-safe way -- channels can be shared between isolates and their methods called from any isolate.
Events cannot be directly sent to a channel. Instead, reactive values can be attached to channels. All events that a reactive value produces from that point end up in the channel.
Once the
seal
method is called on the channel, no more reactive values can be attached to it.c.seal() c.attach(r) // this call will not attach a reactive
The isolate stops once its channel is sealed, and all the attached reactive values unreact. This indicates no more events will arrive to the isolate.
the type of events in this channel