You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempt to fetch an incoming value from the channel associated with this receiver, returning an error if the channel is empty or if all senders have been dropped.
This is slightly misleading and it sort of indicates bad behavior on the part of the queue if there are messages in the queue but it is disconnected. The actual behavior is correct, it won't return disconnected unless the queue is empty. However, the documentation implies that it could return Disconnected even if there are items remaining in the queue.
This is an important distinction because it is not possible to build a proper system of communicating processes without such behavior.
I think it should read,
Attempt to fetch an incoming value from the channel associated with this receiver.
Returns:
- `Ok(T)`
- `Err(Disconnected)` if the queue is empty and all `Senders` have been dropped.
- `Err(Empty)` if the queue is empty but the channel is not disconnected.
The text was updated successfully, but these errors were encountered:
The docs for
try_recv
stateThis is slightly misleading and it sort of indicates bad behavior on the part of the queue if there are messages in the queue but it is disconnected. The actual behavior is correct, it won't return disconnected unless the queue is empty. However, the documentation implies that it could return
Disconnected
even if there are items remaining in the queue.This is an important distinction because it is not possible to build a proper system of communicating processes without such behavior.
I think it should read,
The text was updated successfully, but these errors were encountered: