mirror of
https://git.robbyzambito.me/zits
synced 2026-02-04 03:34:48 +00:00
WAY FASTER but doesn't send all?
Seems to not flush the last message
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user