From f79a24bc2d4bbec2a28d3c4935e0535e7dd0632d Mon Sep 17 00:00:00 2001 From: Patrick Lee Scott Date: Sat, 6 Jun 2026 10:34:49 -0500 Subject: [PATCH] docs: correct outbox claim timing back to in-transaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PR #53 review (6885393) reworded the with_bus outbox path to say the row is claimed *post-commit*. That described OutboxDispatcher::dispatch_ids — a separate primitive used only by transport conformance tests. The actual with_bus path (AggregateCommit::commit) claims each row in the commit transaction via claim_at before commit_batch writes it (born InFlight under a short lease), then publishes via publish_claimed after commit. Restore the accurate in-transaction wording in the README and the with_bus doc comment. Implements [[tasks/distributed-tooling-crate-extraction]] Co-Authored-By: Claude Opus 4.8 --- README.md | 8 ++++---- src/microsvc/runtime.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index dba1a57..22b15d3 100644 --- a/README.md +++ b/README.md @@ -739,10 +739,10 @@ How a committed row reaches the bus depends on whether a bus is attached to the service: - **Bus attached (`service.with_bus(bus)`)** — `repo.outbox(msg).commit(agg)` - commits the row, then **immediately** after commit claims it under a short - lease and publishes it. A crash before the publish, or a publish failure, - leaves the row claimed under that lease; when the lease expires the polling - worker takes it. + claims the row in the commit transaction (born `InFlight` under a short lease) + and publishes it **immediately** after commit. A crash before the publish, or a + publish failure, leaves the row claimed under that lease; when the lease expires + the polling worker takes it. - **No bus** — the row is committed `pending` and a worker publishes it. The polling worker is the durable backstop in both cases. It is the same diff --git a/src/microsvc/runtime.rs b/src/microsvc/runtime.rs index 11576c3..b86b1c2 100644 --- a/src/microsvc/runtime.rs +++ b/src/microsvc/runtime.rs @@ -34,9 +34,9 @@ where /// /// Two effects, both composing with the rest of the builder: /// - installs an outbox publisher on the repository, so - /// `repo.outbox(msg).commit(agg)` publishes immediately after commit - /// through this bus — the row is claimed under a short lease for that - /// publish, and the polling worker stays the crash/retry backstop; + /// `repo.outbox(msg).commit(agg)` claims the row in the commit transaction + /// and publishes it immediately after commit through this bus (the polling + /// worker stays the crash/retry backstop); /// - captures how to consume, so [`run`](Self::run) listens for the /// registered command names (competing) and subscribes to the event names /// (fan-out).