take method
Take a message from the mailbox.
If the mailbox is empty this will synchronously block until message is available or a timeout occurs. If the mailbox is closed then take will throw StateError.
If not timeout
is provided then this method will block
indefinitely.
If timeout
is provided then this will block for at most timeout
.
If the timeout expires before a message is available then this will
throw a TimeoutException.
The timeout
supports a resolution of microseconds.
Implementation
Uint8List take({Duration? timeout}) {
if (timeout != null) {
return _takeTimed(timeout);
} else {
return _take();
}
}