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
//! Pluggable admission-control hook for spawns and message sends.
//!
//! This replaces the upstream `tenant::quota::QuotaEnforcer` coupling: instead
//! of the scheduler depending on a concrete multi-tenant quota type, it depends
//! on this trait. Hosts that need per-tenant quotas, per-actor memory budgets,
//! or rate limiting implement [`ResourcePolicy`] and install it via
//! [`ActorScheduler::with_resource_policy`](crate::ActorScheduler::with_resource_policy).
//!
//! The default policy is [`NoopPolicy`], which admits everything.
use crateResult;
/// Admission control for actor spawns and message sends.
///
/// Called synchronously on the hot path (`spawn`, `send`, `send_batch`), so
/// implementations must be cheap and non-blocking.
///
/// All methods have default implementations that admit everything, so
/// policies only need to override what they enforce.
/// The default policy: admit all spawns and sends.
;