feat: implement endpoint link and exit handling
This commit is contained in:
parent
9a7cc8faed
commit
981ab22c5c
3 changed files with 121 additions and 12 deletions
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue