pub struct WorkloadDriver { /* private fields */ }Implementations§
Source§impl WorkloadDriver
impl WorkloadDriver
Sourcepub fn release_cap_slot(&mut self, request_uuid: Uuid, now_ms: f64)
pub fn release_cap_slot(&mut self, request_uuid: Uuid, now_ms: f64)
Failure-path companion: release a cap slot and terminate the owning session.
No-op if on_complete already ran. Used when a request task is cancelled
or panics before reaching on_complete.
Terminating the session (marking it exhausted) prevents run_workload from
deadlocking: pop_ready skips sessions with in_flight.is_some(), so a
leaked session would leave is_drained stuck at false forever.
pub fn pop_ready(&mut self, now_ms: f64, limit: usize) -> Vec<ReadyTurn>
pub fn on_output_token( &mut self, request_uuid: Uuid, token_id: u32, ) -> Result<()>
pub fn on_complete(&mut self, request_uuid: Uuid, now_ms: f64) -> Result<()>
pub fn on_terminal( &mut self, request_uuid: Uuid, now_ms: f64, rejected: bool, ) -> Result<()>
pub fn next_ready_time_ms(&mut self) -> Option<f64>
pub fn is_drained(&self) -> bool
pub fn total_turns(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkloadDriver
impl RefUnwindSafe for WorkloadDriver
impl Send for WorkloadDriver
impl Sync for WorkloadDriver
impl Unpin for WorkloadDriver
impl UnsafeUnpin for WorkloadDriver
impl UnwindSafe for WorkloadDriver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more