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

Channel error docs #41103

Merged
merged 1 commit into from
Apr 10, 2017
Merged

Channel error docs #41103

merged 1 commit into from
Apr 10, 2017

Conversation

projektir
Copy link
Contributor

@projektir projektir commented Apr 6, 2017

r? @steveklabnik

I'm going to need some help on this one, a few ambiguities.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

#[derive(PartialEq, Eq, Clone, Copy, Debug)]
#[stable(feature = "rust1", since = "1.0.0")]
pub enum TryRecvError {
/// This channel is currently empty, but the sender(s) have not yet
/// This `channel` is currently empty, but the `Sender`(s) have not yet
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

channel and Sender here are ambiguous, could refer to either sync or async. How should something like this be resolved?

Copy link
Member

@GuillaumeGomez GuillaumeGomez Apr 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By providing a little extra explanation. I think it's the easiest way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a bit of extra information + links above.

#[derive(PartialEq, Eq, Clone, Copy, Debug)]
#[stable(feature = "mpsc_recv_timeout", since = "1.12.0")]
pub enum RecvTimeoutError {
/// This channel is currently empty, but the sender(s) have not yet
/// This `channel` is currently empty, but the `Sender`(s) have not yet
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@@ -544,36 +551,46 @@ impl<T> UnsafeFlavor<T> for Receiver<T> {
}

/// Creates a new asynchronous channel, returning the sender/receiver halves.
/// All data sent on the sender will become available on the receiver, and no
/// send will block the calling thread (this channel has an "infinite buffer").
/// All data sent on the [`Sender`] will become available on the [`Receiver`] in
Copy link
Contributor Author

@projektir projektir Apr 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expanding the docs on channel (and sync_channel below) - most of this is adapted from the mspc module page since that's where the bulk of this is explained.

@steveklabnik
Copy link
Member

I will review this tomorrow, unless someone else from @rust-lang/docs beats me to it 😄

@GuillaumeGomez
Copy link
Member

@projektir: Actually, except for the confusing things you reported, it's all good. Please just add a small explanation every time it's needed and it'll be all good.

Also, when done updating, please squash your commits.

/// This channel's sending half has become disconnected, and there will
/// never be any more data received on this channel
/// This `channel`'s sending half has become disconnected, and there will
/// never be any more data received on this channel.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

channel is repeated here. Is it wanted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really have a strong opinion on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GuillaumeGomez are you looking for a change here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least an answer. :-/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything wrong with mentioning 'channel' twice here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frewsxcv yeah, this was the original text and it sounded OK to me so I left it alone, but after talking to @GuillaumeGomez I changed it to a more terse sentence (check the latest commit, this is outdated).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tend to use backticks (`) to form code-related words, not bold.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frewsxcv ...then you and @GuillaumeGomez may be in disagreement. I was using (`) prior to mark channel and Sender, but I was not linking them because they are ambiguous (could be sync_channel and SyncSender. We talked about it and opted for bold instead.

So we need to figure out how this should be resolved long term, because I've already updated my PR like 3 times and I'm rather confused as to what's expected here. 😛

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I understand, nevermind my comment. Sorry for the confusion!

I'll let @GuillaumeGomez review since it sounds like you've already spoken with them about this pull request.

…cumentation to channel() and sync_channel(); adding more links #29377
@projektir
Copy link
Contributor Author

@GuillaumeGomez I added bolding instead of the `. I think it works well. Commits are squashed.

@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Apr 10, 2017

📌 Commit 28a232a has been approved by GuillaumeGomez

@bors
Copy link
Contributor

bors commented Apr 10, 2017

⌛ Testing commit 28a232a with merge 2bdf368...

bors added a commit that referenced this pull request Apr 10, 2017
Channel error docs

r? @steveklabnik

I'm going to need some help on this one, a few ambiguities.
@bors
Copy link
Contributor

bors commented Apr 10, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: GuillaumeGomez
Pushing 2bdf368 to master...

@bors bors merged commit 28a232a into rust-lang:master Apr 10, 2017
@projektir projektir deleted the channel_error_docs branch April 10, 2017 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants