Skip to content

Document event_loop_factory usage #15576

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

Merged
merged 1 commit into from
Jul 11, 2014
Merged

Document event_loop_factory usage #15576

merged 1 commit into from
Jul 11, 2014

Conversation

mrmonday
Copy link
Contributor

Add a couple of lines mentioning event_loop_factory - no clear error message is given if you attempt to perform I/O in tasks created in this fashion. I spent a many hours debugging this yesterday which would have been avoided if it were documented.

@@ -166,8 +166,13 @@
//! ```rust
//! use std::task::TaskBuilder;
//! use green::{SchedPool, PoolConfig, GreenTaskBuilder};
//! use rustuv;
Copy link
Member

Choose a reason for hiding this comment

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

Won't this need an extern crate rustuv declaration as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Meant to type extern crate and not use, good spot.

Copy link
Member

Choose a reason for hiding this comment

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

The test case is also auto-wrapped in fn main() where extern crate definitions aren't allowed, so you'll have to add a secret fn main() wrapper yourself. I'd recommend running rustdoc --test just to make sure it checks out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up and fixed :)

Add a couple of lines mentioning event_loop_factory - no clear error message is
given if you attempt to perform I/O in tasks created in this fashion.
bors added a commit that referenced this pull request Jul 11, 2014
Add a couple of lines mentioning event_loop_factory - no clear error message is given if you attempt to perform I/O in tasks created in this fashion. I spent a many hours debugging this yesterday which would have been avoided if it were documented.
@bors bors closed this Jul 11, 2014
@bors bors merged commit b5dd258 into rust-lang:master Jul 11, 2014
@mrmonday mrmonday deleted the patch-1 branch July 15, 2014 14:12
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.

3 participants