Skip to main content

alien_commands/
types.rs

1// Re-export all commands types from alien-core
2pub use alien_core::commands_types::*;
3
4/// Default interval between lease polls, in seconds.
5///
6/// Used by app-owned pull receivers.
7pub const DEFAULT_POLL_INTERVAL_SECS: u64 = 5;
8
9/// Default maximum number of leases requested per poll.
10pub const DEFAULT_MAX_LEASES: usize = 1;
11
12/// Default lease duration requested per poll, in seconds.
13///
14/// There is no lease-renew call in the protocol: a command's execution
15/// budget is `min(envelope.deadline, lease_expires_at - safety_margin)`.
16pub const DEFAULT_LEASE_SECONDS: u64 = 60;
17
18/// Maximum interval reached by the receiver's empty/error poll backoff.
19pub const DEFAULT_POLL_MAX_INTERVAL_MS: u64 = 30_000;
20
21/// Fractional randomization applied to receiver poll sleeps.
22pub const DEFAULT_POLL_JITTER: f64 = 0.1;
23
24/// Time allowed for in-flight handlers to finish before abort and release.
25pub const DEFAULT_DRAIN_TIMEOUT_MS: u64 = 30_000;