# `DripDrop.AdapterPools.WDRR`
[🔗](https://github.com/agoodway/dripdrop/blob/v0.1.0/lib/dripdrop/adapter_pools/wdrr.ex#L1)

Smooth weighted round-robin allocator for outbound adapter pools.

Counters live in ETS and reset on application restart. The database remains
the source of truth for membership, adapter health, and capacity.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `pick_active_member`

```elixir
@spec pick_active_member(DripDrop.AdapterPool.t(), DripDrop.SequenceVersion.t()) ::
  {:ok, DripDrop.AdapterPoolMember.t()} | {:error, :pool_exhausted}
```

Picks a member whose adapter is enabled (`active = true`), without health or
cap filtering. Used by enrollment-time reassign when every regular candidate
has been exhausted and we need *some* pin so the enrollment can proceed.

# `pick_healthy_member`

```elixir
@spec pick_healthy_member(DripDrop.AdapterPool.t(), DripDrop.SequenceVersion.t()) ::
  {:ok, DripDrop.AdapterPoolMember.t()} | {:error, :pool_exhausted}
```

Picks a member whose adapter is currently in a usable health state, ignoring
daily-cap headroom. Used by dispatch-time auto-rebind: if the pinned adapter
has gone resting or inactive we need a sender that can send right now, not
one that is itself resting.

# `pick_member`

```elixir
@spec pick_member(DripDrop.AdapterPool.t(), DripDrop.SequenceVersion.t()) ::
  {:ok, DripDrop.AdapterPoolMember.t()} | {:error, :pool_exhausted}
```

Picks one eligible member for a pool and sequence version.

---

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