Applies configurable token-bucket throttling before outbound sends.
Global, per-recipient, per-group, and minimum-delay limits are combined into an updated worker state with actionable retry information.
@type bucket() :: %{tokens: float(), last_ms: integer()}
@type state_data() :: %{ global: bucket() | nil, per_jid: %{optional(String.t()) => bucket()}, per_group: %{optional(String.t()) => bucket()}, last_send_at_ms: integer() | nil }
@spec check_and_update(map(), String.t()) :: {:ok, map()} | {:error, term(), map()}
@spec new() :: state_data()