You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering how to integrate grpc-rs with the futures/tokio ecosystem on stable rust. As far as I understand grpc-rs uses the IO reactor of grpc-core, so there isn't a way to drive futures to completion on the tokio reactor used for other things in rust. Is this correct? If so, how would you chain futures of grpc-rs and other async IO stuff using tokio?
Thanks in advance for the help.
The text was updated successfully, but these errors were encountered:
I'm using latest master branch of tokio with grpc-rs.
grpc client can drive its stream receiver and send it out through mpsc channel's sender, then the other side can be processed by tokio reactor.
Again, with a mpsc channel (futures 0.1 since grpc is not using the newly updated std::future) can pump data into grpc's sink. It works with futures 0.3's compat features too.
futures = "0.3"
tokio = { version = "0.2", features = ["sync", "macros", "rt-threaded", "time", "fs"] }
grpcio = { version = "0.6", features = ["openssl"] }
I can confirm that mpsc channel sender works (although I suspect that's because sending a message is not actually a future), async mutex works, as well, but fs doesn't. tokio::fs::write produces following panic:
grpc-poll-0' panicked at 'not currently running on the Tokio runtime.
I'm wondering how to integrate grpc-rs with the futures/tokio ecosystem on stable rust. As far as I understand grpc-rs uses the IO reactor of grpc-core, so there isn't a way to drive futures to completion on the tokio reactor used for other things in rust. Is this correct? If so, how would you chain futures of grpc-rs and other async IO stuff using tokio?
Thanks in advance for the help.
The text was updated successfully, but these errors were encountered: