Skip to content

Compat with tokio::spawn #15

@jon-chuang

Description

@jon-chuang

It would be very cool if a Compat could be produced for consuming the Spawner in the Tokio Handler so that the non-tokio runtime can spawn Tokio tasks.

The way I'm thinking to do it is to first, have the background thread do a sleep(u64::MAX) so that it can never process any spawned tasks.

Then, we hijack the Spawner from the handler (currently impossible as spawner field along with other needed data types are pub(crate)) and process tasks from it by putting them onto the current runtime's task queue.

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