G sessions: the runner answers mesh/capabilities and drops a bundle's sessions when its channel closes
Builds: design 47 G §576, §518, §622, A-49 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
stdio "git.novox.be/novox/mesh-sdk/go"
|
||||
"git.novox.be/novox/mesh-sdk/go/buscalls"
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
@@ -392,6 +393,16 @@ func Start(module, entry string, env []string, mesh Bus, logf func(string, ...an
|
||||
if asked, err = mesh.Ask(m.Params); err == nil {
|
||||
result = asked
|
||||
}
|
||||
case stdio.CapabilitiesCall:
|
||||
// The capability words this runner states (design 47 G §576); a Bus that states none answers none.
|
||||
words := []string{}
|
||||
if w, ok := mesh.(interface{ CapabilityWords() []string }); ok {
|
||||
words = w.CapabilityWords()
|
||||
}
|
||||
var raw []byte
|
||||
if raw, err = json.Marshal(map[string]any{"words": words}); err == nil {
|
||||
result = json.RawMessage(raw)
|
||||
}
|
||||
case "mesh/subscribe":
|
||||
mu.Lock()
|
||||
subscriber = c
|
||||
@@ -577,6 +588,10 @@ func Start(module, entry string, env []string, mesh Bus, logf func(string, ...an
|
||||
for _, stop := range watches {
|
||||
stop()
|
||||
}
|
||||
// A session of the bundle's put or get ends with its channel (design 47 G §518).
|
||||
if d, ok := mesh.(interface{ DropSessions() }); ok {
|
||||
d.DropSessions()
|
||||
}
|
||||
close(c.dead)
|
||||
mu.Lock()
|
||||
// Only a child that was serving is brought back; one that died in its own handshake was
|
||||
|
||||
Reference in New Issue
Block a user