Skip to content

feat(rt): add TokioExecutor #4

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 22, 2022

Conversation

tomkarw
Copy link
Contributor

@tomkarw tomkarw commented Jul 16, 2022

Hey Sean,
I decided to give hyperium/hyper#2861 a go. I'd like to ramp up the contributions after that.

Not certain what exactly is required, feel free to require additional changes.
I tried to write some basic test, but I don't know of a good way to wait for a spawned task without retaining the handle.

Also, I have a question. Why does the Executor trait require a generic parameter, wouldn't it make sense to only require it on execute function? I.e.:

fn execute<Fut>(&self, fut: Fut)

Closes hyperium/hyper#2861

@davidpdrsn
Copy link
Member

Also, I have a question. Why does the Executor trait require a generic parameter, wouldn't it make sense to only require it on execute function? I.e.:

fn execute<Fut>(&self, fut: Fut)

Then you wouldn't be able to make an executor that only works for certain types of futures. Someone might want impl Executor<MyFuture> for MyExecutor

@seanmonstar
Copy link
Member

Thanks for the PR! Looks like cargo fmt has its own opinions 🙈

@tomkarw tomkarw force-pushed the feat-add-tokio-executor branch from 87adac4 to 12fa630 Compare July 21, 2022 13:29
@tomkarw
Copy link
Contributor Author

tomkarw commented Jul 21, 2022

Rookie mistake, awkward.

Should be fine now.
However, there is a bunch of clippy warnings in there. Do you mind if I fix them up as part of this PR?

@tomkarw tomkarw force-pushed the feat-add-tokio-executor branch 3 times, most recently from e0729b7 to 33cf002 Compare July 21, 2022 17:53
@seanmonstar
Copy link
Member

Looks like Miri doesn't like running Tokio in tests, You could add a #[cfg(not(miri)] attribute on it.

@tomkarw tomkarw force-pushed the feat-add-tokio-executor branch from 33cf002 to 0f05eb9 Compare July 22, 2022 19:52
@seanmonstar seanmonstar merged commit 9214294 into hyperium:master Jul 22, 2022
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.

Provide TokioExecutor implementation in hyper-util
3 participants