S9 kept-call-hook: process.KeptAsk gains the hook and keptOf hands it on

Builds: design 47 H2 H-A-708 (4), H-A-731
This commit is contained in:
2026-11-25 17:14:46 +01:00
parent 4f2c6cbdc8
commit fd01ec91a2
2 changed files with 15 additions and 2 deletions
+10
View File
@@ -227,6 +227,16 @@ func TestACallIsAskedAgainOnlyWhenItReachedNoOne(t *testing.T) {
t.Errorf("%v answered %s", row.err, body)
}
}
// Design 47 H2 H-A-731: the hook a caller gives on its KeptAsk reaches the kept-call form, and a caller giving none gives none.
var hooked []busretry.Waited
k := keptOf("seat:mesh-catalog.revision", KeptAsk{ID: "ask-3", Hook: func(w busretry.Waited) { hooked = append(hooked, w) }}, nil)
if k.Hook == nil || k.Seat != "mesh-catalog" || k.Verb != "revision" || k.Ask != "ask-3" {
t.Fatalf("keptOf gave %+v", k)
}
k.Hook(busretry.Waited{Seat: k.Seat, Verb: k.Verb, Ask: k.Ask, Answered: true})
if len(hooked) != 1 || !hooked[0].Answered || keptOf("seat:mesh-catalog.revision", KeptAsk{}, nil).Hook != nil {
t.Errorf("the hook on KeptAsk: told %+v", hooked)
}
// Design 47 H2 §775, H-A-405: a kept chunked call (CallChunksKept, CallFileKept) asks its verb through the kept-call
// form, carries its one ask id on every chunk's acknowledgement, and past its bound ends with the kept call's words.
send := buscalls.SeatChunks{Seat: "node-build-go", Verb: "output", Call: "c1"}