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

util: Add TokioContext future #2791

Merged
merged 18 commits into from
Aug 27, 2020

Conversation

blasrodri
Copy link
Contributor

Motivation

Run a future on a custom executor using the tokio runtime.
Resolves: #2776

Solution

Run a future on a custom executor using the tokio runtime.
Resolves: tokio-rs#2776
@blasrodri
Copy link
Contributor Author

blasrodri commented Aug 24, 2020

Hi @LucioFranco ! This is still a very WIP
Still needs to be polished (at least) with regards to:

  • features (not sure I fully understand how to do it best)
  • docs...

tokio-util/Cargo.toml Outdated Show resolved Hide resolved
tokio-util/src/context.rs Outdated Show resolved Hide resolved
tokio-util/src/context.rs Outdated Show resolved Hide resolved
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Looking like a great start! Left some comments, let me know if you have any questions.

tokio-util/tests/context.rs Outdated Show resolved Hide resolved
tokio-util/src/context.rs Outdated Show resolved Hide resolved
tokio-util/Cargo.toml Outdated Show resolved Hide resolved
@blasrodri blasrodri requested a review from LucioFranco August 25, 2020 20:07
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Getting close, a few things we need to clean up first!

tokio-util/src/context.rs Show resolved Hide resolved
tokio-util/src/context.rs Show resolved Hide resolved
tokio-util/src/context.rs Outdated Show resolved Hide resolved
tokio-util/src/context.rs Outdated Show resolved Hide resolved
tokio-util/src/context.rs Show resolved Hide resolved
@@ -38,4 +38,6 @@ cfg_compat! {
pub mod compat;
}

pub mod context;
Copy link
Member

Choose a reason for hiding this comment

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

@hawkw do you think we should feature flag this around rt?

tokio-util/tests/context.rs Show resolved Hide resolved
@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-task Module: tokio/task C-enhancement Category: A PR with an enhancement or bugfix. labels Aug 27, 2020
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Looks great! Left some comments around docs.

tokio-util/src/context.rs Outdated Show resolved Hide resolved
tokio-util/src/context.rs Outdated Show resolved Hide resolved
tokio-util/src/context.rs Show resolved Hide resolved
@LucioFranco
Copy link
Member

I applied the suggestions, will merge once CI passes, thanks @blasrodri for pushing this through!

@LucioFranco LucioFranco changed the title Tokio utils tokio context util: Add TokioContext future Aug 27, 2020
@LucioFranco LucioFranco merged commit d9d909c into tokio-rs:master Aug 27, 2020
@blasrodri blasrodri deleted the tokio-utils-tokio-context branch August 27, 2020 16:06
LucioFranco added a commit that referenced this pull request Oct 14, 2020
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
LucioFranco added a commit that referenced this pull request Oct 14, 2020
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
LucioFranco added a commit that referenced this pull request Oct 14, 2020
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
LucioFranco added a commit that referenced this pull request Oct 14, 2020
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
LucioFranco added a commit that referenced this pull request Oct 14, 2020
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
LucioFranco added a commit that referenced this pull request Oct 14, 2020
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
LucioFranco added a commit that referenced this pull request Oct 14, 2020
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate C-enhancement Category: A PR with an enhancement or bugfix. M-task Module: tokio/task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

util: Add a TokioContext future
3 participants