kube_runtime::scheduler

Function scheduler

Source
pub fn scheduler<T: Eq + Hash + Clone, S: Stream<Item = ScheduleRequest<T>>>(
    requests: S,
) -> Scheduler<T, S>
Expand description

Stream transformer that delays and deduplicates items.

Items are deduplicated: if an item is submitted multiple times before being emitted then it will only be emitted at the earliest Instant.

Items can be “held pending” if the item doesn’t match some predicate. Items trying to schedule an item that is already pending will be discarded (since it is already going to be emitted as soon as the consumer is ready for it).

The Scheduler terminates as soon as requests does.