-
Notifications
You must be signed in to change notification settings - Fork 108
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 a loom aware block_on for running futures to completion #148
Conversation
Since I first wrote this as a standalone crate, I had to rely only on the public API of |
I think it would make sense to include a loom executor in here, maybe even behind a futures feature flag. |
Hmm.... Wait a minute. There already is a I have completely missed it, because it's not in the docs.rs documentation. We should probably make it build the documentation with all features enabled. Otherwise the extra features become very hard to discover. |
@faern yeah, that is probably also a good idea too :) |
Should probably also add the |
I can do that. Do you want me to pull in the Personally I would not be a huge fan of pulling in |
I think it's better to do what Tokio does and just enable the feature on nightly only --- I wasn't actually aware of the |
Replaced by #151... Kind of |
The fact that there is a `futures` feature flag and a `block_on` method was a bit hard to discover. At least for me. That lead me to create #148. Turns out it was not needed. To make it more discoverable, this PR makes docs.rs build the documentation with all features active, so the extra functionality they enable are visible. It also uses the unstable `doc_cfg` attribute to make it more obvious in the docs that those items are feature gated. This is taken more or less directly from how the tokio crate does the same thing. Co-authored-by: Eliza Weisman <eliza@buoyant.io>
This solves tokio-rs/tokio#2463
Adding a way to run a
Future
to completion inside a loom model. Allows usingloom
to test the correctness ofFuture::poll
implementations.Do you want to have this in
loom
? If not, I might publish it asloom-executor
or something along those lines. But the further upstream it can be the better IMO.Feedback on the implementation greatly appreciated!