Struct ginepro::LoadBalancedChannelBuilder [−][src]
pub struct LoadBalancedChannelBuilder<T, S> { /* fields omitted */ }
Expand description
Builder to configure and create a LoadBalancedChannel
.
Implementations
impl<S> LoadBalancedChannelBuilder<DnsResolver, S> where
S: TryInto<ServiceDefinition> + 'static,
S::Error: Into<Box<dyn Error + Send + Sync>> + Send + Sync,
impl<S> LoadBalancedChannelBuilder<DnsResolver, S> where
S: TryInto<ServiceDefinition> + 'static,
S::Error: Into<Box<dyn Error + Send + Sync>> + Send + Sync,
Set the ServiceDefinition
of the gRPC server service
- e.g.
my.service.uri
and5000
.
All the service endpoints of a ServiceDefinition
will be
constructed by resolving all ips from ServiceDefinition::hostname
, and
using the portnumber ServiceDefinition::port
.
pub fn lookup_service<T: LookupService + Send + Sync + 'static>(
self,
lookup_service: T
) -> LoadBalancedChannelBuilder<T, S>
pub fn lookup_service<T: LookupService + Send + Sync + 'static>(
self,
lookup_service: T
) -> LoadBalancedChannelBuilder<T, S>
Set a custom LookupService
.
Set the how often, the client should probe for changes to gRPC server endpoints. Default interval in seconds is 10.
Set a timeout that will be applied to every new Endpoint
.
pub fn resolution_strategy(
self,
resolution_strategy: ResolutionStrategy
) -> LoadBalancedChannelBuilder<T, S>
pub fn resolution_strategy(
self,
resolution_strategy: ResolutionStrategy
) -> LoadBalancedChannelBuilder<T, S>
Set the ResolutionStrategy
.
Default set to ResolutionStrategy::Lazy
.
If ResolutionStrategy::Lazy
the domain name will be resolved after-the-fact.
Instead, if ResolutionStrategy::Eager
is set the domain name will be attempted resolved
once before the LoadBalancedChannel
is created, which ensures that the channel
will have a non-empty of IPs on startup. If it fails the channel creation will also fail.
Configure the channel to use tls.
A tls_config
MUST be specified to use the HTTPS
scheme.
Construct a LoadBalancedChannel
from the LoadBalancedChannelBuilder
instance.
Auto Trait Implementations
impl<T, S> !RefUnwindSafe for LoadBalancedChannelBuilder<T, S>
impl<T, S> !Send for LoadBalancedChannelBuilder<T, S>
impl<T, S> !Sync for LoadBalancedChannelBuilder<T, S>
impl<T, S> Unpin for LoadBalancedChannelBuilder<T, S> where
S: Unpin,
impl<T, S> !UnwindSafe for LoadBalancedChannelBuilder<T, S>
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more