pub struct Config {
pub registry: Arc<Mutex<Registry>>,
pub threads: usize,
pub catch_panics: bool,
pub max_message_size: usize,
pub read_timeout: Duration,
pub write_timeout: Duration,
pub tcp_nodelay: Option<bool>,
pub storage_directory: PathBuf,
pub maximum_buffer_size: usize,
}Expand description
Configuration for the tokio runtime.
Fields§
§registry: Arc<Mutex<Registry>>Registry for metrics.
threads: usizeNumber of threads to use for the runtime.
catch_panics: boolWhether or not to catch panics.
max_message_size: usizeMaximum size used for all messages sent over the wire.
We use this to prevent malicious peers from sending us large messages that would consume all of our memory.
If this value is not synchronized across all connected peers, chunks will be parsed incorrectly (any non-terminal chunk must be of ~this size).
Users of this runtime can chunk messages of this size to send over the wire.
read_timeout: DurationDuration after which to close the connection if no message is read.
write_timeout: DurationDuration after which to close the connection if a message cannot be written.
tcp_nodelay: Option<bool>Whether or not to disable Nagle’s algorithm.
The algorithm combines a series of small network packets into a single packet before sending to reduce overhead of sending multiple small packets which might not be efficient on slow, congested networks. However, to do so the algorithm introduces a slight delay as it waits to accumulate more data. Latency-sensitive networks should consider disabling it to send the packets as soon as possible to reduce latency.
Note: Make sure that your compile target has and allows this configuration otherwise panics or unexpected behaviours are possible.
storage_directory: PathBufBase directory for all storage operations.
maximum_buffer_size: usizeMaximum buffer size for operations on blobs.
tokio defaults this value to 2MB.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)