Struct ic_websocket_cdk::WsInitParams
source · pub struct WsInitParams {
pub handlers: WsHandlers,
pub gateway_principal: String,
pub max_number_of_returned_messages: usize,
pub send_ack_interval_ms: u64,
pub keep_alive_timeout_ms: u64,
}Expand description
Parameters for the IC WebSocket CDK initialization. For default parameters and simpler initialization, use WsInitParams::new.
Fields§
§handlers: WsHandlersThe callback handlers for the WebSocket.
gateway_principal: StringThe principal of the WS Gateway that will be polling the canister.
max_number_of_returned_messages: usizeThe maximum number of messages to be returned in a polling iteration.
Defaults to 10.
send_ack_interval_ms: u64The interval at which to send an acknowledgement message to the client, so that the client knows that all the messages it sent have been received by the canister (in milliseconds).
Must be greater than keep_alive_timeout_ms.
Defaults to 60_000 (60 seconds).
keep_alive_timeout_ms: u64The delay to wait for the client to send a keep alive after receiving an acknowledgement (in milliseconds).
Must be lower than send_ack_interval_ms.
Defaults to 10_000 (10 seconds).
Implementations§
source§impl WsInitParams
impl WsInitParams
sourcepub fn new(handlers: WsHandlers, gateway_principal: String) -> Self
pub fn new(handlers: WsHandlers, gateway_principal: String) -> Self
Creates a new instance of WsInitParams, with default interval values.
Trait Implementations§
source§impl Clone for WsInitParams
impl Clone for WsInitParams
source§fn clone(&self) -> WsInitParams
fn clone(&self) -> WsInitParams
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more