pub struct SchedulerConfig {
pub max_partitions_per_scan: u16,
pub rotation_window_ms: u64,
}Expand description
Tunable scheduler behavior, separate from the topology-level
PartitionConfig. Lives in ff-scheduler because every field is a
scheduler-internal scan policy — none of it leaks into persisted keys,
Lua scripts, or cross-crate wire shapes (unlike PartitionConfig).
If a future RFC needs a unified knob surface we can lift this up; not
premature today.
Fields§
§max_partitions_per_scan: u16Maximum number of partitions to probe in a single
Scheduler::claim_for_worker call before giving up and returning
Ok(None).
Trade-off: smaller = lower worst-case no-hit latency per claim
call (each probe is a ZRANGEBYSCORE round-trip, ~0.1ms LAN), larger
= better fairness per call (more partitions seen before a worker
yields). At the default of 32 with 256 partitions, any given
partition is reached within ceil(256/32) = 8 scheduling ticks —
combined with the rotation cursor, that bounds worst-case
starvation for a specific partition’s head-of-queue execution.
rotation_window_ms: u64Duration a rotation cursor position stays stable before advancing.
Trade-off: too short and tight-loop workers re-enter the same window on every tick (cursor never actually rotates relative to them); too long and slow-poll workers keep seeing the same cursor across many ticks (reducing fairness benefit). 250ms is a middle ground: tight-loop workers (sub-ms claim cycles) see a fresh window every ~250 ticks, 1s-poll workers see a fresh window every 4 ticks. Tune down if your workers all idle-poll >1s; tune up if you run a fleet of tight-loop claimers and want less cursor churn.
Implementations§
Source§impl SchedulerConfig
impl SchedulerConfig
Sourcepub const DEFAULT_MAX_PARTITIONS_PER_SCAN: u16 = 32
pub const DEFAULT_MAX_PARTITIONS_PER_SCAN: u16 = 32
Default scan budget: probe 32 partitions per claim call.
See Self::max_partitions_per_scan for the latency/fairness
rationale.
Sourcepub const DEFAULT_ROTATION_WINDOW_MS: u64 = 250
pub const DEFAULT_ROTATION_WINDOW_MS: u64 = 250
Default rotation window: advance the cursor every 250ms.
See Self::rotation_window_ms.
Trait Implementations§
Source§impl Clone for SchedulerConfig
impl Clone for SchedulerConfig
Source§fn clone(&self) -> SchedulerConfig
fn clone(&self) -> SchedulerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SchedulerConfig
impl Debug for SchedulerConfig
Source§impl Default for SchedulerConfig
impl Default for SchedulerConfig
impl Copy for SchedulerConfig
Auto Trait Implementations§
impl Freeze for SchedulerConfig
impl RefUnwindSafe for SchedulerConfig
impl Send for SchedulerConfig
impl Sync for SchedulerConfig
impl Unpin for SchedulerConfig
impl UnsafeUnpin for SchedulerConfig
impl UnwindSafe for SchedulerConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more