Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support plugable Timer implementation #2040

Open
xofyarg opened this issue Nov 7, 2024 · 0 comments
Open

Support plugable Timer implementation #2040

xofyarg opened this issue Nov 7, 2024 · 0 comments

Comments

@xofyarg
Copy link

xofyarg commented Nov 7, 2024

Feature Request

Crates

tonic

Motivation

Tonic's builtin transport rely on tokio runtime, but with some simple tweaking, I managed to make it work with another runtime, by providing a customized hyper::rt::Executor and Connector(tower_service::Service), ... except for the timer, which is buried deeply in the channel implementation.

Proposal

Because the callsite accepts a hyper::rt::Timer naturally, I wonder if there's any chance to expose it somehow via an interface, to allow the users set it to implementations other than tokio.

P.S.

I split the feature channel into channel and channel-full, and feature guarded some of the code related to tokio. So when only channel is enabled, it's possible to use most of the builtin channel without rely on tokio(#152). Please let me know if this is something you wanted, then I can start a PR.

channel = [
  "dep:hyper", "hyper?/client",
  "dep:hyper-util", "hyper-util?/client",
  "dep:tower", "tower?/buffer", "tower?/discover", "tower?/util",
  "dep:tokio",
]
channel-full = [
  "channel",
  "hyper-util?/client-legacy", "hyper-util?/tokio",
  "tower?/balance", "tower?/limit",
  "tokio?/time",
  "dep:hyper-timeout",
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant