Explicit bounded scheduling policy for a slow effect resource.
max_queued counts waiting work, not the running worker. A value of zero
permits only the in-flight effect.
Summary
Functions
Builds a bounded coalescing policy whose queue metadata fits the wire contract.
Builds a bounded FIFO policy whose queue metadata fits the wire contract.
Builds a latest-wins policy. A superseding request cancels older work.
Types
@type mode() :: :fifo | :latest_wins | :coalescing
@type t() :: %MingaEditor.Effect.Policy{max_queued: non_neg_integer(), mode: mode()}
Functions
@spec coalescing(pos_integer()) :: t()
Builds a bounded coalescing policy whose queue metadata fits the wire contract.
@spec fifo(non_neg_integer()) :: t()
Builds a bounded FIFO policy whose queue metadata fits the wire contract.
@spec latest_wins() :: t()
Builds a latest-wins policy. A superseding request cancels older work.