The original handle_cast had nested `if`s: outer branch on demand > 0, inner branch on buffer-over-capacity. Split into: - handle_cast with a `when demand > 0` guard for the hot path that skips the buffer entirely. - A fallback clause that computes whether the new size would overflow and delegates to buffer_packet/3. - buffer_packet/3 has two clauses — one for the drop-oldest path (with telemetry + warning) and one for the simple append path. Both share the final `maybe_activate_backpressure |> reply_noemit` step. All 19 existing PacketProducer tests pass; dialyzer stays clean. |
||
|---|---|---|
| .. | ||
| aprsme | ||
| aprsme_web | ||
| mix/tasks | ||
| aprs_web.ex | ||
| aprsme.ex | ||