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
//! # Per-task admission policy
//!
//! The controller admits **one task per slot**.
//! The slot is the spec's slot key ([`TaskSpec::slot`](crate::TaskSpec::slot)), which falls back to the task
//! name when not set explicitly - so the admission unit is the *slot*, not the task name (several differently-named runs may share one slot).
//!
//! At any given time **one** task may run in a slot.
//! When a new request for the same slot arrives, the admission policy decides what to do.
//!
//! ## Variants
//!
//! - `DropIfRunning`: If the slot is already running, **ignore** the new request.
//! - `Replace`: **Stop** the running task (cancel/remove) and start the new one.
//! - `Queue`: **Enqueue** the new request (FIFO).
//!
//! ## Invariants
//!
//! - Tasks within the same slot never run in parallel (use distinct slots if you need parallel execution).
//! - Queued requests are executed strictly in submission order.
/// Policy controlling how new submissions are handled when a slot is busy.