This document is for Kombu's development version, which can be significantly different from previous releases. Get the stable docs here: 5.3.

# Consumer Scheduling - `kombu.utils.scheduling`

Scheduling Utilities.

class kombu.utils.scheduling.FairCycle(fun, resources, predicate=<class 'Exception'>)

  Cycle between resources.

  Consume from a set of resources, where each resource gets an equal chance to be consumed from.

  ## Arguments:

  > fun (Callable): Callback to call. resources (Sequence[Any]): List of resources. predicate (type): Exception predicate.

  close()

    Close cycle.

  get(callback, **kwargs)

    Get from next resource.

class kombu.utils.scheduling.priority_cycle(it=None)

  Cycle that repeats items in order.

  rotate(last_used)

    Unused in this implementation.

class kombu.utils.scheduling.round_robin_cycle(it=None)

  Iterator that cycles between items in round-robin.

  consume(n)

    Consume n items.

  rotate(last_used)

    Move most recently used item to end of list.

  update(it)

    Update items from iterable.

class kombu.utils.scheduling.sorted_cycle(it=None)

  Cycle in sorted order.

  consume(n)

    Consume n items.