websockets-rs / rust-websocket

A WebSocket (RFC6455) library written in Rust
http://websockets-rs.github.io/rust-websocket/
MIT License
1.55k stars 223 forks source link

Tokio reform #165

Closed FreeFull closed 5 years ago

FreeFull commented 6 years ago

With the recent tokio reform, tokio-core has been deprecated in favour of the tokio crate. It would be nice to migrate over; There have been some breaking changes, but at first glance it doesn't seem like it'll be too hard.

davidtwco commented 6 years ago

Without this, using rust-websocket in tandem with any other crate that has switched to tokio from tokio-core becomes challenging as Cargo struggles to resolve the dependencies.

enzious commented 6 years ago

So... I got a fork working with the latest hyper (switched to httparse though) and tokio reform: https://github.com/enzious/rust-websocket

I wouldn't call it a quality job but it's working for me so far on the project I'm using it for. The only thing failing atm is doc tests.

Maybe some of my dabbling will help :)

enzious commented 6 years ago

@illegalprime

tinaun commented 6 years ago

@enzious any idea how much work it would take to upgrade to futures 0.2?

enzious commented 6 years ago

@tinaun Apparently futures 0.2 is not going to last long so waiting until 0.3 seems best:

https://github.com/tokio-rs/tokio/issues/312

mati865 commented 6 years ago

@enzious if your work is nearly done you could open PR and hopefully somebody competent would review it.

illegalprime commented 6 years ago

@enzious I'll review it if you make a PR

Jannis commented 6 years ago

I second the request to move from tokio_core to tokio. I've been trying to integrate websocket into a project based on tokio but couldn't get it to work:

  1. Using the async Server doesn't work because it takes an old tokio_core::reactor::Handle.
  2. Manually implementing a stream of async upgrades and spawning their accept/reject futures using tokio::spawn doesn't work because those futures do not satisfy the Send trait.

I would appreciate a migration that works with futures 0.1 and the latest tokio. I'm happy to test and review any time.

omarabid commented 6 years ago

So is there any progress on this one?

FreeFull commented 5 years ago

Given #199 has been merged, is there anything left to do now? Or can the issue be closed?

vi commented 5 years ago

Probably can be closed.


Next on the line is Hyper reform. Hyper 0.12 seems to be another http library, not just next version of Hyper 0.10. Some low-level abilities seem to be missing.

Maybe rust-websocket should be based not on hyper, but on something else?