rust-websocket-lite icon indicating copy to clipboard operation
rust-websocket-lite copied to clipboard

Clarify async use of websocket-lite

Open jjl opened this issue 3 years ago • 2 comments

Hi,

The README on this repo says "You can use this crate in both asynchronous (futures-based) and synchronous code.". I suppose that's technically true, but it doesn't really hint that you'll be pulling in all of tokio.

jjl avatar May 14 '21 08:05 jjl

"pulling in all of tokio" -> in the synchronous case? That's true, would an opt-out tokio feature be of use?

Note that the codec is still defined in terms of the tokio_util crate, but with only the codec feature required, this dependency is a lot smaller.

1tgr avatar May 14 '21 09:05 1tgr

I'm writing an async program, so I can't really use anything here higher up the chain than websocket-codec without pulling in tokio. I think the tokio feature would probably be good for people who are writing synchronous programs, however. It's quite large.

jjl avatar May 14 '21 09:05 jjl