T1a verb-timeout-ask: a bundle's ask waits the timeout its verb's definition names
The runner reads the `timeout` (whole seconds) of a seat's verb from the seat list's definitions beside `chunked` and hands it to the bus connection's ask (AskWithin, AskAsWithin, AskAsChunkedWithin); a verb that names none, a seat the definitions do not hold and a module's tool wait the runner's own bound, RequestTimeout. Builds: design 47 H §760, H-A-43 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
@@ -150,9 +151,9 @@ func (c *Conn) publishRefused(err error) bool {
|
||||
// askCalled asks once on a caller-named subject. fallBack says the call reached nobody — nothing serves that
|
||||
// subject yet, or the bus refused this user its publish — so it may be asked on the subject that names no
|
||||
// caller without being done twice.
|
||||
func (c *Conn) askCalled(subject string, data []byte) (answered Answered, fallBack bool, err error) {
|
||||
func (c *Conn) askCalled(subject string, data []byte, within time.Duration) (answered Answered, fallBack bool, err error) {
|
||||
ctx, cancel := context.WithCancelCause(context.Background())
|
||||
ctx, stop := context.WithTimeout(ctx, RequestTimeout)
|
||||
ctx, stop := context.WithTimeout(ctx, waitOf(within))
|
||||
defer stop()
|
||||
c.calls.mu.Lock()
|
||||
if c.calls.pending == nil {
|
||||
|
||||
Reference in New Issue
Block a user