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

Reimplement Core::run #143

Closed
asomers opened this issue Feb 19, 2018 · 5 comments
Closed

Reimplement Core::run #143

asomers opened this issue Feb 19, 2018 · 5 comments

Comments

@asomers
Copy link
Contributor

asomers commented Feb 19, 2018

tokio-core's Core::run method evaluated a future to completion, then returned the result. tokio currently lacks any equivalent. current_thread::spawnis the closest, but it can't return a result. Please consider adding an equivalent method to tokio.

@carllerche
Copy link
Member

This is included as part of #141. 🍾

@carllerche
Copy link
Member

That PR has landed. You can now use CurrentThread::block_on which is equivalent.

@asomers
Copy link
Contributor Author

asomers commented Feb 24, 2018

Thanks. I'm using CurrentThread::block_on_all and it's working. I'm relying on the ability to call Handle::current outside of the Reactor loop, though, and I'm not sure that's guaranteed to work.

@carllerche
Copy link
Member

carllerche commented Feb 25, 2018 via email

@asomers
Copy link
Contributor Author

asomers commented Feb 25, 2018

See #153

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

No branches or pull requests

2 participants