#[non_exhaustive]pub enum AdmissionPolicy {
DropIfRunning,
Replace,
Queue,
}controller only.Expand description
The conflict policy for one controller submission.
The policy does not change task execution settings in TaskSpec.
It only controls admission to the slot.
Choose Queue when every item should be considered in FIFO order.
Choose Replace when the next item should contain the newest value.
Choose DropIfRunning when duplicate work may be skipped.
Match with a wildcard arm because this enum is non-exhaustive.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DropIfRunning
Rejects new work while the slot has an owner.
The task body does not start. The current owner and existing queue stay unchanged.
A watched submission resolves to TaskOutcome::Rejected
with RejectionKind::SlotBusy.
Replace
Makes this submission the next candidate and retires the current owner.
On a busy slot, this submission creates or replaces the queue head. Repeated replacements retain only the newest head.
FIFO items behind the head keep their order; Replace does not clear the entire queue.
A registered owner receives a removal request. When registry admission is still pending, the controller waits for that decision and orders removal only after acceptance. The replacement starts after registry cleanup and physical release of the owner.
Replacement has no separate wait timeout. While physical release is pending, snapshots report the slot as
SlotStatusKind::Terminating.
This policy does not use ControllerConfig::max_slot_queue.
Creating a new queue head can still hit the aggregate pending limit.
A displaced watched head resolves with RejectionKind::SupersededByReplace.
Queue
Appends new work to the slot’s FIFO queue.
The current owner leaves the slot first. Pending submissions are then considered from the front of the queue.
A later Replace submission can still displace that head.
The per-slot queue limit can reject with RejectionKind::QueueFull.
The aggregate pending limit can reject with RejectionKind::ResourceLimit.
Waiting for controller admission has no built-in deadline and is outside the task’s per-attempt timeout.
Keep the returned TaskId when the application may need to remove or cancel queued work.
See ControllerConfig for both limits.
Trait Implementations§
Source§impl Clone for AdmissionPolicy
impl Clone for AdmissionPolicy
Source§fn clone(&self) -> AdmissionPolicy
fn clone(&self) -> AdmissionPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more