-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rendezvous stream for synchronous channel messaging #8908
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
Conversation
} | ||
|
||
/// Creates a stream whose channel, upon sending a message, blocks until the message is received. | ||
pub fn rendezvous<T: Send>() -> (SyncPort<T>, SyncChan<T>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rendezvous
is nice, but it seems peculiar to mismatch the names of the types of the port/chan. Maybe it could be sync_stream
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommended the name rendezvous
because it comes from a plan 9 synchronization primitive that does exactly the same thing. Plus (imo) it does suggest the functionality, as the sender and receiver are "rendezvousing" on the sent data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(it's also the name of the ada primitive which also does the same thing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok; rendezvous
is fine by me, I was just curious about the mismatch.
Ready for retry @anasazi |
yep. bsd is rather unstable at the moment. |
SyncChan blocks after sending a message until the SyncPort acknowledges receipt of the message.
Finally. |
You guys rock. |
Make docs more consistent changelog: none This just fixes some docs to make them more consistent. I mostly just changed `// Good`, `// Bad`, etc to `Use instead:`.
Improve lint doc consistency changelog: none This is a continuation of rust-lang#8908. Notable changes: - Removed empty `Known Problems` sections - Removed "Good"/"Bad" language (replaced with "Use instead") - Removed (and added some 😄) duplication - Ignored the [`create_dir`] example so it doesn't create `clippy_lints/foo` 😄
SyncChan blocks after sending a message until the SyncPort acknowledges receipt of the message.