Add non-async version of connect_with_connector
#695
Labels
A-tonic
C-enhancement
Category: New feature or request
E-help-wanted
Call for participation: Help is requested to fix this issue.
E-medium
Call for participation: Experience needed to fix: Medium / intermediate
Milestone
Feature Request
Crates
tonic
Motivation
I am using tonic with a custom transport protocol, so I am using
connect_with_connector
. However, my connector does not need toawait
anything, so I would like a version ofconnect_with_connector
that is notasync fn
.Proposal
Add a method on
tonic::transport::Endpoint
likepub fn connect_with_connector<C>(&self, connector: C) -> Result<Channel, Error>
, emphasis on the non-async part. This would follow how the default transport (TCP) hasasync fn connect
andfn connect_lazy
.Alternatives
My custom transport is also infallible, so another option could be
pub fn connect_with_connector_connected<C>(&self, connector: C) -> Channel where C: ...
and...
is a non-future type for converting Uri to Channel.The text was updated successfully, but these errors were encountered: