This document describes the current stable version of Kombu (4.5). For development docs, go here.

Consumer Scheduling - kombu.utils.scheduling

Scheduling Utilities.

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

Cycle between resources.

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

Parameters:
  • fun (Callable) – Callback to call.
  • resources (Sequence[Any]) – List of resources.
  • predicate (type) – Exception predicate.
close()[source]

Close cycle.

get(callback, **kwargs)[source]

Get from next resource.

class kombu.utils.scheduling.priority_cycle(it=None)[source]

Cycle that repeats items in order.

rotate(last_used)[source]

Unused in this implementation.

class kombu.utils.scheduling.round_robin_cycle(it=None)[source]

Iterator that cycles between items in round-robin.

consume(n)[source]

Consume n items.

rotate(last_used)[source]

Move most recently used item to end of list.

update(it)[source]

Update items from iterable.

class kombu.utils.scheduling.sorted_cycle(it=None)[source]

Cycle in sorted order.

consume(n)[source]

Consume n items.