1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*******************************************************************************
*
* Copyright (c) 2025 - 2026.
* Haixing Hu, Qubit Co. Ltd.
*
* All rights reserved.
*
******************************************************************************/
//! Built-in CAS preset constants.
use Duration;
use DEFAULT_RETRY_MAX_ATTEMPTS;
/// Default maximum attempts inherited from `qubit-retry`.
pub const DEFAULT_CAS_MAX_ATTEMPTS: u32 = DEFAULT_RETRY_MAX_ATTEMPTS;
/// Maximum attempts for the contention-adaptive strategy.
pub const CONTENTION_ADAPTIVE_MAX_ATTEMPTS: u32 = 1000;
/// Initial retry delay for the contention-adaptive strategy.
pub const CONTENTION_ADAPTIVE_INITIAL_DELAY: Duration = from_millis;
/// Maximum retry delay for the contention-adaptive strategy.
pub const CONTENTION_ADAPTIVE_MAX_DELAY: Duration = from_secs;
/// Total elapsed-time budget for the contention-adaptive strategy.
pub const CONTENTION_ADAPTIVE_MAX_ELAPSED: Duration = from_secs;
/// Jitter factor for the contention-adaptive strategy.
pub const CONTENTION_ADAPTIVE_JITTER_FACTOR: f64 = 0.25;
/// Maximum attempts for the latency-first strategy.
pub const LATENCY_FIRST_MAX_ATTEMPTS: u32 = 100;
/// Total elapsed-time budget for the latency-first strategy.
pub const LATENCY_FIRST_MAX_ELAPSED: Duration = from_secs;
/// Maximum attempts for the reliability-first strategy.
pub const RELIABILITY_FIRST_MAX_ATTEMPTS: u32 = 5000;
/// Initial retry delay for the reliability-first strategy.
pub const RELIABILITY_FIRST_INITIAL_DELAY: Duration = from_secs;
/// Maximum retry delay for the reliability-first strategy.
pub const RELIABILITY_FIRST_MAX_DELAY: Duration = from_secs;
/// Total elapsed-time budget for the reliability-first strategy.
pub const RELIABILITY_FIRST_MAX_ELAPSED: Duration = from_secs;
/// Jitter factor for the reliability-first strategy.
pub const RELIABILITY_FIRST_JITTER_FACTOR: f64 = 0.1;