pub struct SkeletonScheduler<R: RuntimeRepository> { /* private fields */ }Expand description
Compile-safe scheduler skeleton for queue -> lease dispatch.
Implementations§
Source§impl<R: RuntimeRepository> SkeletonScheduler<R>
impl<R: RuntimeRepository> SkeletonScheduler<R>
pub fn new(repository: R) -> Self
Sourcepub fn with_circuit_breaker(self, breaker: Arc<CircuitBreaker>) -> Self
pub fn with_circuit_breaker(self, breaker: Arc<CircuitBreaker>) -> Self
Attach a shared circuit breaker to this scheduler.
When the breaker is Open, all dispatch calls return
SchedulerDecision::Backpressure until the probe window elapses.
Sourcepub fn dispatch_one(
&self,
worker_id: &str,
) -> Result<SchedulerDecision, KernelError>
pub fn dispatch_one( &self, worker_id: &str, ) -> Result<SchedulerDecision, KernelError>
Attempt to dispatch one eligible attempt to worker_id.
Sourcepub fn dispatch_one_with_context(
&self,
worker_id: &str,
context: Option<&DispatchContext>,
) -> Result<SchedulerDecision, KernelError>
pub fn dispatch_one_with_context( &self, worker_id: &str, context: Option<&DispatchContext>, ) -> Result<SchedulerDecision, KernelError>
Dispatch one attempt to worker_id with optional context for tenant/priority/capability routing.
Context is passed through for future filtering or sorting; current implementation
uses the same candidate list as dispatch_one.
If context.max_queue_depth is set and the number of dispatchable candidates is
greater than or equal to that limit, returns SchedulerDecision::Backpressure
without acquiring any lease.
Auto Trait Implementations§
impl<R> Freeze for SkeletonScheduler<R>where
R: Freeze,
impl<R> RefUnwindSafe for SkeletonScheduler<R>where
R: RefUnwindSafe,
impl<R> Send for SkeletonScheduler<R>
impl<R> Sync for SkeletonScheduler<R>
impl<R> Unpin for SkeletonScheduler<R>where
R: Unpin,
impl<R> UnsafeUnpin for SkeletonScheduler<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for SkeletonScheduler<R>where
R: UnwindSafe,
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