pub struct Config {
pub bind_addr: Vec<SocketAddr>,
pub stream_config: StreamConfig,
pub receive_buffer_size: usize,
pub receive_backpressure_control: Option<NonZeroUsize>,
}Expand description
Configuration parameters for the reactor.
Fields§
§bind_addr: Vec<SocketAddr>The list of socket addresses where the reactor listens for inbound connections.
stream_config: StreamConfigConfiguration parameters for individual peer connections. This allows the fine tuning of internal buffer sizes etc. Most consumers won’t have to modify the default values.
receive_buffer_size: usizeThe size of the shared receive buffer, i.e. the max number of bytes that can be read in one receive operation. Setting this too low can cause many reads to happen, whereas too high a figure will use up more memory. The default is 1 megabyte.
receive_backpressure_control: Option<NonZeroUsize>Whether the reactor should perform backpressure control on the receive side. Setting this
to Some(n) means that the reactor will start blocking on sending events to the consumer
when the receive channel of size n is full and events are not being read. Setting it to
None means that the capacity of the event channel is unbounded and the reactor will send
events to the consumer as fast as it can, regardless of whether those events are being read
(at all). The default is no backpressure control (None).