WIP: add remaining message types
This commit is contained in:
parent
0e804fc61f
commit
cb37b9b82b
4 changed files with 105 additions and 1 deletions
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue