sdroege / async-tungstenite

Async binding for Tungstenite, the Lightweight stream-based WebSocket implementation
MIT License
396 stars 61 forks source link

Support for the `smol` runtime #113

Open szgupta opened 1 year ago

szgupta commented 1 year ago

Hey! I was looking to use this crate within the context of the smol runtime but realized that only async-std and tokio have builtin integrations.

I was able to follow this example to get it working with smol but was wondering what a builtin smol integration would require. Albeit not a lot of extra code to support outside of the crate, this seems like something that could live nicely in the async-tungstenite crate as an optional feature. After all, async-std uses the smol executor itself.

From a quick glance, the only async-std-specific usage in src/async-std.rs is the use of async_std::net::TcpStream. This can be written in a more std way but still async with a simple smol adapter smol::Async<std::net::TcpStream>.

If you would be open to this, I'm happy to investigate adding support.

sdroege commented 1 year ago

that only async-std and tokio have builtin integrations

Also GLib :)

If you would be open to this, I'm happy to investigate adding support.

Sure, go ahead