Skip to content

Feature idea: support multiple executors #21

Open
@paulkernfeld

Description

@paulkernfeld

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions