Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Integrate with tokio runtime? #117

Open
netvl opened this issue May 5, 2018 · 4 comments
Open

Integrate with tokio runtime? #117

netvl opened this issue May 5, 2018 · 4 comments

Comments

@netvl
Copy link

netvl commented May 5, 2018

I'm currently writing an application which exposes a gRPC service. This application, however, performs other async tasks, not only running the server. I would like to use tokio runtime to run everything in a single event loop, but apparently grpc-rust is not integrated with tokio runtime; it uses cpupool or tokio-core instead. Even though it allows specifying an external event loop for the server, it requires Remote from tokio-core, which is not compatible with tokio::reactor::Handle.

Is integration with tokio runtime planned? As far as I understand, it is the intended way to write async applications now.

@mehcode
Copy link
Contributor

mehcode commented Nov 2, 2018

@stepancheg Can I assume you're not working on this right now? I don't mind jumping in to help here. I suppose we need to update https://github.com/stepancheg/rust-http2 first.

@stepancheg
Copy link
Owner

stepancheg commented Nov 2, 2018

FYI currently I'm doing a big rewrite of rust-http2 API, to make API more similar to h2/grpc-rs.

The task is here: stepancheg/rust-http2#34

(It is mostly done, but cleanup is necessary).

New server API is for instance:

After that, I'm planning to change grpc-rust to have similar API: #137 (making it again more similar to h2/grps-rs; should be easy because the grpc runtime is a thin wrapper around http2 runtime)

While API changes, I'd appreciate feedback about API/design/code review/etc.

Patches are also appreciated of course.

@mehcode
Copy link
Contributor

mehcode commented Nov 5, 2018

tokio-core to tokio isn't a large change. It can just feel large. I've changed over a number of libs already. I'll see what I can do with a PR to rust-http2 to remove tokio-core.

@thedodd
Copy link
Contributor

thedodd commented Jan 29, 2019

We should definitely do this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants