# `MingaEditor.Effect.Policy`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/effect/policy.ex#L1)

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.

# `mode`

```elixir
@type mode() :: :fifo | :latest_wins | :coalescing
```

# `t`

```elixir
@type t() :: %MingaEditor.Effect.Policy{max_queued: non_neg_integer(), mode: mode()}
```

# `coalescing`

```elixir
@spec coalescing(pos_integer()) :: t()
```

Builds a bounded coalescing policy whose queue metadata fits the wire contract.

# `fifo`

```elixir
@spec fifo(non_neg_integer()) :: t()
```

Builds a bounded FIFO policy whose queue metadata fits the wire contract.

# `latest_wins`

```elixir
@spec latest_wins() :: t()
```

Builds a latest-wins policy. A superseding request cancels older work.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
