pub struct WebSocketConfig {
pub url: String,
pub path: Option<String>,
pub message_id_header: Option<String>,
pub routed_queue_capacity: Option<usize>,
pub backlog: Option<u32>,
pub execution_mode: WebSocketExecutionMode,
}Expand description
WebSocket connection configuration.
Fields§
§url: StringFor consumers, the listen address (e.g. “0.0.0.0:9000”). For publishers, the target URL.
path: Option<String>(Consumer only) Optional request path filter. If set, only upgrade requests whose URI path matches exactly are delivered to this consumer.
message_id_header: Option<String>(Consumer only) Header key to extract the message ID from the WebSocket handshake. Defaults to “message-id”.
routed_queue_capacity: Option<usize>(Consumer only) Queue capacity for the routed adapter. Direct response routes do not use this queue. Defaults to 100.
backlog: Option<u32>(Consumer only) TCP listen backlog (pending-connection queue depth) for the accept socket.
Raise this if high-concurrency handshake bursts are being dropped/reset before accept()
can keep up. Defaults to 4096, which is higher than the OS/tokio default of 1024.
execution_mode: WebSocketExecutionMode(Consumer only) Selects whether WebSocket routes run directly or through the routed pipeline.
Implementations§
Source§impl WebSocketConfig
impl WebSocketConfig
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
Creates a new WebSocket configuration with the specified URL.
pub fn with_path(self, path: impl Into<String>) -> Self
pub fn with_backlog(self, backlog: u32) -> Self
pub fn with_execution_mode(self, execution_mode: WebSocketExecutionMode) -> Self
Trait Implementations§
Source§impl Clone for WebSocketConfig
impl Clone for WebSocketConfig
Source§fn clone(&self) -> WebSocketConfig
fn clone(&self) -> WebSocketConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more