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]

[src]

Connect to a server by IP address.

This method will create a new channel builder.

[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).

[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.

[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.

[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.

Trait Implementations

impl<'a> Debug for ChannelBuilder<'a>
[src]

[src]

Formats the value using the given formatter.