Skip to content

Consider using spawn and channel in specific async runtime. #608

@Berrysoft

Description

@Berrysoft

I see that EventStream is using std::thread and std::sync::mpsc at now. It is of course an improvement according to #448. However, I'd like to suggest a possible improvement, with the usage of spawn and channels in specific async runtime, for example, tokio or async-std. Therefore, the async runtime could manage the event stream thread.

The replacement in tokio is spawn and mpsc.

The replacement in async-std is spawn and channel.

Both of them should be drop-in replacement, rewritting some functions to async ones. I'd like to open a pull request later, trying to add the implementation as an optional feature, and keep the original implementation as a fallback one.

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