Kombu.Utils.Scheduling.Cycle (Kombu v0.1.0)

Copy Markdown View Source

Polling cycle implementation supporting :round_robin, :priority, and :sorted (kombu.utils.scheduling.round_robin_cycle, priority_cycle, sorted_cycle).

Summary

Types

cycle_type()

@type cycle_type() :: :round_robin | :priority | :sorted

t()

@type t() :: %Kombu.Utils.Scheduling.Cycle{items: list(), type: cycle_type()}

Functions

consume(cycle, n)

@spec consume(t(), non_neg_integer()) :: list()

get(cycle)

@spec get(t()) :: {term() | nil, t()}

new(type \\ :round_robin, items \\ [])

@spec new(cycle_type() | String.t(), Enumerable.t()) :: t()

rotate(cycle, last_used)

@spec rotate(t(), term()) :: t()

update(cycle, items)

@spec update(t(), Enumerable.t()) :: t()