Skip to content

Commit

Permalink
feat: increase default parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ilbertt committed Nov 29, 2023
1 parent 7ca9b77 commit a7ef0c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/ic-websocket-cdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ pub use types::{
const LABEL_WEBSOCKET: &[u8] = b"websocket";

/// The default maximum number of messages returned by [ws_get_messages] at each poll.
const DEFAULT_MAX_NUMBER_OF_RETURNED_MESSAGES: usize = 10;
const DEFAULT_MAX_NUMBER_OF_RETURNED_MESSAGES: usize = 50;
/// The default interval at which to send acknowledgements to the client.
const DEFAULT_SEND_ACK_INTERVAL_MS: u64 = 60_000; // 60 seconds
const DEFAULT_SEND_ACK_INTERVAL_MS: u64 = 300_000; // 5 minutes
/// The default timeout to wait for the client to send a keep alive after receiving an acknowledgement.
const DEFAULT_CLIENT_KEEP_ALIVE_TIMEOUT_MS: u64 = 10_000; // 10 seconds
const DEFAULT_CLIENT_KEEP_ALIVE_TIMEOUT_MS: u64 = 60_000; // 1 minute

/// The initial nonce for outgoing messages.
const INITIAL_OUTGOING_MESSAGE_NONCE: u64 = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use pocket_ic::PocketIc;
use super::wasm::{load_canister_wasm_from_bin, load_canister_wasm_from_path};

/// The maximum number of messages returned by the **ws_get_messages** method.
pub const DEFAULT_TEST_MAX_NUMBER_OF_RETURNED_MESSAGES: u64 = 20;
pub const DEFAULT_TEST_MAX_NUMBER_OF_RETURNED_MESSAGES: u64 = 50;

/// The interval between sending acks from the canister.
/// Set to a high value to make sure the canister doesn't reset the client while testing other functions.
Expand Down
6 changes: 3 additions & 3 deletions src/ic-websocket-cdk/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,20 +381,20 @@ pub struct WsInitParams {
/// The callback handlers for the WebSocket.
pub handlers: WsHandlers,
/// The maximum number of messages to be returned in a polling iteration.
/// Defaults to `10`.
/// Defaults to `50`.
pub max_number_of_returned_messages: usize,
/// The 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).
/// Defaults to `300_000` (5 minutes).
pub send_ack_interval_ms: u64,
/// The 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).
/// Defaults to `60_000` (1 minute).
pub keep_alive_timeout_ms: u64,
}

Expand Down

0 comments on commit a7ef0c4

Please sign in to comment.