feat: implement endpoint link and exit handling

This commit is contained in:
CJ van den Berg 2026-03-10 23:01:59 +01:00
parent 9a7cc8faed
commit 981ab22c5c
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 121 additions and 12 deletions

View file

@ -259,7 +259,13 @@ const StdioEndpoint = struct {
return tp.exit_error(error.UnknownWireId, null);
},
.transport_error => |te| return tp.exit(te.reason),
.link, .exit => return tp.exit_error(error.UnexpectedMessage, null),
.exit => |e| {
// Remote side notifying that a linked actor has exited.
// Forward to the local actor with that wire ID (best-effort).
if (self.wire_ids.get(e.id)) |actor|
actor.send(.{ "exit", e.reason }) catch {};
},
.link => return tp.exit_error(error.LinkNotSupported, null),
}
}