Expand description
Host-independent adaptive admission-control state machine.
The crate owns controller state and returns Action values for the embedding host to
perform. It does not execute tasks, read clocks, or create timers.
use adaptive_admission_core::{Action, Config, Controller, Priority};
let mut controller = Controller::new(Config::default())?;
let submission = controller.submit(Priority::new(100)?, 1_000.into())?;
assert_eq!(
submission.actions,
vec![Action::Start { request_id: submission.request_id }],
);Structs§
- Config
- Configuration for one controller instance.
- Controller
- Deterministic admission-control state machine.
- Controller
Diagnostics - Current controller values intended for diagnostics and operational visualization.
- PidConfig
- Parameters for the admission PID feedback loop.
- Priority
- Request priority in the inclusive range
0..=767; lower values are more important. - Request
Id - Identifier generated by one controller instance.
- Statistics
Config - Bounds and readiness criteria for execution statistics.
- Statistics
Snapshot - Statistics published from one coherent execution window.
- Submission
- Result of submitting one request to the controller.
- Timestamp
- Monotonic timestamp expressed in milliseconds.
Enums§
- Action
- Decision that the embedding host must apply.
- Cancellation
Reason - Reason why queued work was cancelled.
- Config
Error - Invalid controller configuration.
- Controller
Error - Failure to apply an event to the current controller state.
- Eviction
Reason - Reason why queued work expired.
- Outcome
- Host-reported result of started work.
- Priority
Error - Invalid priority construction.
- Rejection
Reason - Reason why submitted work was not admitted.