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

Add recv_timeout to std::sync::mpsc #962

Closed
alexcrichton opened this issue Mar 11, 2015 · 5 comments
Closed

Add recv_timeout to std::sync::mpsc #962

alexcrichton opened this issue Mar 11, 2015 · 5 comments
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.

Comments

@alexcrichton
Copy link
Member

Now that we're using condition variables for blocking, it should be relatively easy to add a recv_timeout method once the timeout concept is stabilized and wait_timeout on Condvar is also stabilized.

@canndrew
Copy link
Contributor

Any progress on this in the last year? Would you accept a PR for it?

emilio added a commit to emilio/servo that referenced this issue May 19, 2016
This approach uses a secondary thread to manage the timeout + select.

This is not ideal, but it can be vastly improved if something is done about
rust-lang/rfcs#962.

The other apparently cleaner option, having the returned value not being an
ipc-sender, but a struct containing the sender and the Thread handle (which
would allow unparking), wouldn't work across IPC.
emilio added a commit to emilio/servo that referenced this issue May 19, 2016
This approach uses a secondary thread to manage the timeout + select.

This is not ideal, but it can be vastly improved if something is done about
rust-lang/rfcs#962.

The other apparently cleaner option, having the returned value not being an
ipc-sender, but a struct containing the sender and the Thread handle (which
would allow unparking), wouldn't work across IPC.
emilio added a commit to emilio/servo that referenced this issue May 19, 2016
This approach uses a secondary thread to manage the timeout + select.

This is not ideal, but it can be vastly improved if something is done about
rust-lang/rfcs#962.

The other apparently cleaner option, having the returned value not being an
ipc-sender, but a struct containing the sender and the Thread handle (which
would allow unparking), wouldn't work across IPC.
bors added a commit to rust-lang/rust that referenced this issue Jun 22, 2016
std: sync: Implement recv_timeout()

This is an attempt to implement rust-lang/rfcs#962.

I'm not sure about if a change like this would require an rfc or something like
that, and this surely needs a lot more testing, but I wanted to take some eyes
on it before following.

cc @metajack @asajeffrey servo/servo#11279 servo/servo#11283

r? @aturon
@emilio
Copy link

emilio commented Jun 30, 2016

This landed on rust-lang/rust#33748, though it's not stable yet. I guess this issue should be closed?

@alexcrichton
Copy link
Member Author

Indeed!

@alexcrichton
Copy link
Member Author

Note that the tracking issue is v

@alexcrichton
Copy link
Member Author

rust-lang/rust#34029

@petrochenkov petrochenkov added the T-libs-api Relevant to the library API team, which will review and decide on the RFC. label Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

4 participants