WIP: add remaining message types

This commit is contained in:
CJ van den Berg 2026-03-07 14:51:25 +01:00
parent 0e804fc61f
commit cb37b9b82b
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
4 changed files with 105 additions and 1 deletions

View file

@ -143,11 +143,17 @@ const StdioEndpoint = struct {
fn dispatch_frame(self: *@This(), frame: []const u8) !void {
const msg = try protocol.decode(frame);
switch (msg) {
.send => |s| {
_ = s;
_ = self;
return tp.exit_error(error.UnexpectedSend, null);
},
.send_named => |s| {
const actor = tp.env.get().proc(s.to_name);
try actor.send_raw(tp.message{ .buf = s.payload });
_ = self;
},
.link, .exit, .proxy_id, .transport_error => return tp.exit_error(error.UnexpectedMessage, null),
}
}

View file

@ -69,6 +69,7 @@ const Parent = struct {
try std.testing.expectEqualStrings("test_actor", s.to_name);
try std.testing.expect(try cbor.match(s.payload, .{ "hello", "from_child" }));
},
else => return unexpected(thespian.message{ .buf = frame }),
}
self.frame_received = true;
}