diff options
| author | Robby Zambito <contact@robbyzambito.me> | 2026-01-07 22:48:50 -0500 |
|---|---|---|
| committer | Robby Zambito <contact@robbyzambito.me> | 2026-01-07 23:19:19 -0500 |
| commit | 45feccbad8c7306c15137a6003f3df1183d9c2a9 (patch) | |
| tree | 5a541a2e45eb2fbe8f0ec4ba3da0829d029ccd45 /src/Server/Client.zig | |
| parent | 96a3705069cf33a00ded143f876734c2a045cf1e (diff) | |
WAY FASTER but doesn't send all?
Seems to not flush the last message
Diffstat (limited to 'src/Server/Client.zig')
| -rw-r--r-- | src/Server/Client.zig | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/Server/Client.zig b/src/Server/Client.zig index 047f38d..a7dd007 100644 --- a/src/Server/Client.zig +++ b/src/Server/Client.zig @@ -1,5 +1,6 @@ -const parse = @import("parse.zig"); -const Message = parse.Message; +const message = @import("message.zig"); +const parse = message.parse; +const Message = message.Message; const std = @import("std"); const Queue = std.Io.Queue; @@ -68,17 +69,7 @@ pub fn start(self: *Client, io: std.Io) !void { // }; // switch (msg) { // .MSG => |m| { - // try self.to_client.print( - // "MSG {s} {s} {s} {d}\r\n", - // .{ - // m.subject, - // m.sid, - // m.reply_to orelse "", - // m.payload.len, - // }, - // ); - // try m.payload.write(self.to_client); - // try self.to_client.print("\r\n", .{}); + // }, // .HMSG => |hmsg| { // try self.to_client.print("HMSG {s} {s} {s} {d} {d}\r\n", .{ @@ -106,9 +97,7 @@ pub fn start(self: *Client, io: std.Io) !void { // _ = try self.to_client.write("PONG\r\n"); // }, // .INFO => |info| { - // _ = try self.to_client.write("INFO "); - // try std.json.Stringify.value(info, .{}, self.to_client); - // _ = try self.to_client.write("\r\n"); + // }, // .@"-ERR" => |s| { // _ = try self.to_client.print("-ERR '{s}'\r\n", .{s}); @@ -177,8 +166,8 @@ test send { } } -pub fn next(self: *Client, allocator: std.mem.Allocator) !Message { - return parse.next(allocator, self.from_client); +pub fn next(self: *Client) !message.Control { + return parse.control(self.from_client); } test next { |
