Struct jsonrpsee::async_client::ClientBuilder
source · pub struct ClientBuilder { /* private fields */ }
Expand description
Builder for Client
.
Implementations§
source§impl ClientBuilder
impl ClientBuilder
sourcepub fn request_timeout(self, timeout: Duration) -> ClientBuilder
pub fn request_timeout(self, timeout: Duration) -> ClientBuilder
Set request timeout (default is 60 seconds).
sourcepub fn max_concurrent_requests(self, max: usize) -> ClientBuilder
pub fn max_concurrent_requests(self, max: usize) -> ClientBuilder
Set max concurrent requests (default is 256).
sourcepub fn max_notifs_per_subscription(self, max: usize) -> ClientBuilder
pub fn max_notifs_per_subscription(self, max: usize) -> ClientBuilder
Set max concurrent notification capacity for each subscription; when the capacity is exceeded the subscription will be dropped (default is 1024).
You may prevent the subscription from being dropped by polling often enough
Subscription::next()
such that
it can keep with the rate as server produces new items on the subscription.
Note: The actual capacity is num_senders + max_subscription_capacity
because it is passed to [futures_channel::mpsc::channel
].
sourcepub fn id_format(self, id_kind: IdKind) -> ClientBuilder
pub fn id_format(self, id_kind: IdKind) -> ClientBuilder
Configure the data type of the request object ID (default is number).
sourcepub fn set_max_logging_length(self, max: u32) -> ClientBuilder
pub fn set_max_logging_length(self, max: u32) -> ClientBuilder
Set maximum length for logging calls and responses.
Logs bigger than this limit will be truncated.
sourcepub fn ping_interval(self, interval: Duration) -> ClientBuilder
pub fn ping_interval(self, interval: Duration) -> ClientBuilder
Set the interval at which pings frames are submitted (disabled by default).
Periodically submitting pings at a defined interval has mainly two benefits:
- Directly, it acts as a “keep-alive” alternative in the WebSocket world.
- Indirectly by inspecting debug logs, it ensures that the endpoint is still responding to messages.
The underlying implementation does not make any assumptions about at which intervals pongs are received.
Note: The interval duration is restarted when
- a frontend command is submitted
- a reply is received from the backend
- the interval duration expires
sourcepub fn build_with_tokio<S, R>(self, sender: S, receiver: R) -> Clientwhere
S: TransportSenderT + Send,
R: TransportReceiverT + Send,
pub fn build_with_tokio<S, R>(self, sender: S, receiver: R) -> Clientwhere
S: TransportSenderT + Send,
R: TransportReceiverT + Send,
Trait Implementations§
source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more