Struct copra::channel::ChannelBuilder
[−]
[src]
pub struct ChannelBuilder<'a> { /* fields omitted */ }
Channel factory, which can be used to setup a new channel
This builder ease the configuration of the channel. You can chain up the configuration methods,
and call build
to consume it, which will return a future that resolves to a Channel
.
Methods
impl<'a> ChannelBuilder<'a>
[src]
fn single_server(addr: &'a str, handle: Handle) -> Self
[src]
Connect to a server by IP address.
This method will create a new channel builder.
fn protocol(self, protocol: Protocol) -> Self
[src]
[WIP] Choose a communication protocol.
This RPC framework is intended to support multiple communication protocols (e.g. grpc and plain http). Currently, it is recommended to leave this to default value.
Default to brpc
protocol (brpc
is a pure protobuf message protocol
used in brpc framework).
fn deadline(self, deadline: Option<Duration>) -> Self
[src]
[WIP] Set request deadline.
A request will be set to failed if it reaches its deadline.
Default to None
. which means we will wait until the reponse is returned or
some error is raised.
fn max_concurrency(self, max_concurrency: u32) -> Self
[src]
Set concurrency limit.
The number of unresolved requests will be confined below max_concurrency
.
When this limit is reached, new request will fail immidiately. Thus, it can
be used to model backpressure.
Default to None
, no limit imposed.
fn build(self) -> ChannelBuildFuture
[src]
Consume the builder and begin to prepare connection.
This method returns a future that will resolve to a Channel
.
Errors
The future will yield a ChannelBuildError
if any error occurs when seting
up the connection.