H-A-196: a process pulls a durable consumer once

A second pull loop on a durable the same process already pulls takes every other
event from the first, and nothing said so: the tool runner's two loops on the
indexer bundle's durable left the catalog seat's revision verb stale twice today.
The SDK now refuses it at bind time, naming the durable and both binders:
PullOnce claims a durable (by stream, name and the time the bus made it), and
HearEvents and Conn.Consume claim through it, releasing on stop, drain or the
bus ending the loop.

Builds: design 47 H H-A-196
This commit is contained in:
2026-11-20 22:05:14 +01:00
parent c15460faf5
commit c1c369f50c
5 changed files with 160 additions and 3 deletions
+5
View File
@@ -71,6 +71,11 @@ func (c *Conn) Consume(ctx context.Context, stream string, handle func(*Message)
if err != nil {
return fmt.Errorf("binding %s's queue consumer %s on %s: %w", c.account.Module, name, stream, err)
}
release, err := PullOnce(cons, "")
if err != nil {
return err
}
defer release()
return runQueue(ctx, fetchOne(cons), handle)
}