H-A-196: one SDK function claims, pulls and wraps a durable's loop

The tool runner would otherwise copy the claim's wrapper (review round 1, P7):
ConsumeOnce claims the durable, pulls it and answers the loop, and HearEvents
uses it; Conn.Consume claims through the same guard. A drain keeps its claim
until the loop ended, and the loop's Closed is closed only once the claim is
released, so a bind during a drain is refused and one after it is never.

Builds: design 47 H H-A-196, H-A-197
This commit is contained in:
2026-11-20 22:18:43 +01:00
parent c1c369f50c
commit becaf8096a
4 changed files with 67 additions and 26 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ 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, "")
release, err := pullOnce(cons, callerOutside())
if err != nil {
return err
}