WAY FASTER but doesn't send all?

Seems to not flush the last message
This commit is contained in:
2026-01-07 22:48:50 -05:00
parent 96a3705069
commit 45feccbad8
6 changed files with 425 additions and 138 deletions

View File

@@ -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 {