From d1d0014242262faaad1a58e616122a15801245a2 Mon Sep 17 00:00:00 2001 From: JohnnyT Date: Wed, 30 Sep 2026 10:07:42 -0600 Subject: [PATCH] Amends ADR-0075: which callbacks receive opts Appends a second Amendment to ADR-0075, at proposed, amending decision 8 point b in part. A {module, opts} registration's options reach the context deliver/3 and cancel/2 receive, under :opts. perform/2 receives the session's plan context without :opts, because a handler instruction does not name the registration it came from. A processor that needs its configuration when it performs carries it in the instruction payload deliver/3 plans, as Statifier.Send.BasicHTTP does with its transport. This records what statifier 2.10.0 ships and decides nothing beyond which callbacks receive :opts. No line is removed. Docs only: no Elixir code is touched. mix adr.check and mix quality --profile merge ran green on this tree. Refs: st-mgxq --- docs/adr/0075-basichttp-event-io-processor.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/adr/0075-basichttp-event-io-processor.md b/docs/adr/0075-basichttp-event-io-processor.md index f07e3857..c8290e98 100644 --- a/docs/adr/0075-basichttp-event-io-processor.md +++ b/docs/adr/0075-basichttp-event-io-processor.md @@ -424,3 +424,35 @@ enqueued is answered 204 again with nothing enqueued. This repository's loopback front, which lives only as long as one test run, does not deduplicate; statifier_router's durable front, which must survive a restart, is the one that will. + +### Amendment 2026-09-30: a registration's options reach the planning callbacks, and `perform/2` gets its configuration through the payload + +Status: proposed (2026-09-30) - amends decision 8 point b in part (which +callbacks receive `:opts`); every other decision, the Amendment above, +and the record's own Status are unchanged. + +Decision 8 point b says a `{module, opts}` registration's options reach +"the plan context a processor's callbacks receive, under an added `:opts` +key". `Statifier.Send.Processor` has three callbacks that take its +`ctx()`: `deliver/3`, `cancel/2` and `perform/2`. The code that +statifier 2.10.0 ships gives `:opts` to two of them. This Amendment +states that rule as the decision: + +- A `{module, opts}` registration's options reach the context + `deliver/3` and `cancel/2` receive, under `:opts` + (`Statifier.Session.Effects`'s private `processor_for/2`, at + `c8894aea`). +- `perform/2` receives the session's plan context without `:opts` + (`Statifier.Session`'s private `perform_instruction/3`, at + `c8894aea`), because a `{:handler, module, payload}` instruction names + its module and not the registration it came from, so the session has + no one registration's options to add. +- A processor that needs its configuration when it performs carries it + in the instruction payload `deliver/3` plans. `Statifier.Send.BasicHTTP` + carries its transport this way. + +The `Statifier.Send.Processor` moduledoc, section "Registration options", +names `deliver/3` and `cancel/2` as the callbacks whose context carries +`:opts`, at `c8894aea`. A bare-module registration is +unchanged: none of its callbacks receives an `:opts` key. This Amendment +decides nothing beyond which callbacks receive `:opts`.