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:
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user