cassandra-rs icon indicating copy to clipboard operation
cassandra-rs copied to clipboard

Use futures crate

Open teburd opened this issue 8 years ago • 5 comments

Many of the async clients/servers are moving towards the common futures/tokio stuff, might be worth integrating cassandra-rs to use the rust futures crate

teburd avatar Aug 30 '16 21:08 teburd

It might. Since this crate is just a wrapper around a C++ codebase, I'm not sure whether it would be meaningful to wrap cassandra-c++ futures in tokio futures, or not.

I would certainly use tokio if/when I work on a native rust driver.

Leaving this open for consideration, though.

tupshin avatar Dec 04 '16 03:12 tupshin

It seems like it wouldn't be too much of a hassle to implement the futures-rs Future trait for this crate's own Future implementation -- that would at least allow for easier interop between the two systems.

cramertj avatar Dec 04 '16 21:12 cramertj

@tupshin I began work on a native rust driver, but the tokio-proto crate clearly wasn't stable yet so I've put it off for now, I got the basic message encoding/decoding pieces sort of hacked together though

teburd avatar Dec 08 '16 18:12 teburd

Tokio is coming along very quickly, and I suspect it will be ready sooner rather than later. I'll be quite interested in contributing to that effort if you decide to push it forward.

tupshin avatar Dec 08 '16 18:12 tupshin

I fully intend on pushing it forward unless someone beats me to it once I see some stability with the Tokio API. It looks like that is finally happening and that the API will fit Cassandra well. Simply having the entire protocol in a manner close to what is needed by tokio is the goal I had with https://github.com/bfrog/cql-protocol while avoiding directly requiring tokio there. Then https://github.com/bfrog/tokio-cql would glue the two. I'd be more than happy to create a group to work on these projects if that sounds interesting to you. I have a strong need for that crate in the near future.

teburd avatar Dec 08 '16 18:12 teburd