sync library
Classes
- BooleanCodec
- BooleanListCodec
- DisconnectedError
-
An error returned from the
recvfunction on aLocalClosableReceiverwhen the Sender calledclose. - DoubleCodec
- DoubleListCodec
- IntCodec
- IntListCodec
-
IsolateReceiver<
T> -
IsolateSender<
T> -
ListSizedTCodec<
T> -
LocalReceiver<
T> - Receiver for a single isolate.
-
LocalSender<
T> - Sender for a single isolate.
- Mutex
- Mutual exclusion.
- OtherError
-
An error returned from the
recvfunction on aLocalClosableReceiverwhen the Sender calledsendError. -
Receiver<
T> - The receiving-half of channel. Receivers do not close if the Sender sends an error.
-
ReceiverImpl<
T> - RecvError
-
An error returned from the
recvfunction on aLocalClosableReceiver. - RecvTimeoutError
-
An error returned from the
recvTimeoutfunction on aLocalClosableReceiver. - RwLock
- Mutual exclusion that supports read and write locks.
-
SendCodec<
T> - The codec use to encode and decode data send over over a channel between isolates.
-
Sender<
T> - The sending-half of channel.
- SendError
- A SendError can only happen if the channel is disconnected, implying that the data could never be received.
- StringCodec
- TimeoutError
-
An error returned from the
recvTimeoutfunction on aLocalClosableReceiverwhen the time limit is reached before the Sender sends any data.
Functions
-
channel<
T> () → (LocalSender< T> , LocalReceiver<T> ) -
Creates a new channel, returning the Sender and
LocalClosableReceiver. Each itemTsent by the Sender will only be seen once by theLocalClosableReceiver. Even if the Sender callsclosewhile theLocalClosableReceivers buffer is not empty, theLocalClosableReceiverwill still yield the remaining items in the buffer until empty. -
isolateChannel<
T, U> (FutureOr< void> func(IsolateSender<U> tx, IsolateReceiver<T> rx), {SendCodec<T> ? toIsolateCodec, SendCodec<U> ? fromIsolateCodec}) → Future<(IsolateSender< T> , IsolateReceiver<U> )> -
isolateChannel is used for bi-directional isolate communication. The returned
Sender and Receiver can communicate with the spawned isolate and
the spawned isolate is passed a Sender and Receiver to communicate with the original isolate.
Each item
Tsent by a Sender will only be seen once by the corresponding Receiver. If the Sender callsclosewhile the Receiver's buffer is not empty, the Receiver will still yield the remaining items in the buffer until empty. Types that can be sent over a SendPort, as defined here https://api.flutter.dev/flutter/dart-isolate/SendPort/send.html , are allow to be sent between isolates. Otherwise atoIsolateCodecand/or afromIsolateCodeccan be passed to encode and decode the messages.