recvTimeout method
Attempts to wait for a value on this receiver with a time limit, returning Err
of:
RecvError$Disconnected if the Sender called close and the buffer is empty.
RecvError$Other if the item in the buffer is an error, indicated by the sender calling addError
.
RecvError$Timeout if the time limit is reached before the Sender sent any more data.
Implementation
@override
Future<Result<T, RecvError>> recvTimeout(Duration timeLimit) async {
try {
return await _next().timeout(timeLimit);
} on TimeoutException catch (timeoutException) {
return Err(RecvError$Timeout(timeoutException));
} catch (error) {
return Err(RecvError$Other(error));
}
}