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

Feature idea: support multiple executors #21

Open
paulkernfeld opened this issue Jan 13, 2021 · 0 comments
Open

Feature idea: support multiple executors #21

paulkernfeld opened this issue Jan 13, 2021 · 0 comments

Comments

@paulkernfeld
Copy link

Right now, it looks like this will always execute using async_std::task::block_on. I bet that will work great for most scenarios, and if that's intended to be the full scope of this crate, that makes sense! 😊

My feature idea is: for use cases that demand extremely small code size, fast compile time, deployment on an exotic platform, the ability to use multiple threads, or maybe just to support someone's preference for a certain executor, what do you think of making the executor pluggable? To be up front, I'm interested in using this with spin_on because I have some non-performance intensive code and I'm looking for really fast compile times.

I can think of two variations of this:

  1. Explicitly support several useful executors
  2. Allow the user to specify their own executor function with a signature similar to fn block_on<F, T>(future: F) -> T where F: Future<Output = T>

I'm pretty sure that this is feasible and I'd be happy to fill in some technical details if this sounds like a desirable feature.

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

1 participant