Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recv_deadline with past instant is ambiguous #975

Open
AurelienFT opened this issue Apr 13, 2023 · 1 comment
Open

recv_deadline with past instant is ambiguous #975

AurelienFT opened this issue Apr 13, 2023 · 1 comment
Labels

Comments

@AurelienFT
Copy link

Hello,

Thanks for your work on this crate.
I find recv_deadline on a channel a bit ambiguous when we pass an Instant that is in the past. This behavior isn't documented and, in my first intuition was: it will not even try to recv as the deadline is already pass. After a test it shows me that even if the deadline is in the past but there is already a message in the channel he will be received.

Do you think the behavior should change or is it possible to document it ?

@taiki-e
Copy link
Member

taiki-e commented Apr 24, 2023

"deadline" relates to whether or not to wait for a message for how long, and I think it is reasonable to receive it if the message is immediately available.

I think it is reasonable to document the behavior.

@taiki-e taiki-e added the docs label Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants