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

Users should be able to implement their own executors #4

Open
Stupremee opened this issue Mar 23, 2020 · 2 comments
Open

Users should be able to implement their own executors #4

Stupremee opened this issue Mar 23, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Stupremee
Copy link
Member

Currently, users are not able to implement the AgnostikExecutor trait for their own executors, because it's impossible to create an instance of the JoinHandle struct.

There should be a way to create a JoinHandle from a Future, which represents the Joinhandle.

@najamelan
Copy link

najamelan commented Jun 2, 2021

I would be interested in this for existing supported executors. Basically I would like to implement the traits for the wrappers in async_executors. The way I saw this was by providing std::convert::From implementations to create JoinHandle from the tokio and async-std JoinHandle types. Would you accept a PR adding those?

It doesn't address the exact issue described here for other executors though.

The reason is that async_executors has a SpawnHandle<Out> trait which is object safe, but which requires listing the output of the joinhandle as a generic. There is user demand for a non-object safe trait that doesn't have generic, but I'd rather not re-introduce a second set of these traits as agnostik already has them, and it would also improve interop.

@Stupremee
Copy link
Member Author

I definitely need to implement this. I don't know why I've never implemented that, but I will try to get back to maintaining this crate in general in the next few weeks.

This will be my first item todo! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants