made some progress on subscriptions

This commit is contained in:
2025-12-09 21:19:12 -05:00
parent 5fd580045d
commit 50870da1d9
3 changed files with 124 additions and 153 deletions

View File

@@ -66,12 +66,14 @@ pub const ClientState = struct {
},
}
}
self.task.cancel(io);
}
pub fn deinit(self: *ClientState, io: std.Io, allocator: std.mem.Allocator) void {
self.task.cancel(io);
self.connect.deinit();
allocator.destroy(self.recv_queue);
_ = allocator;
// allocator.destroy(self.recv_queue);
}
/// Return true if the value was put in the clients buffer to process, else false.
@@ -95,14 +97,11 @@ fn writeOk(out: *std.Io.Writer) !void {
}
fn writePong(out: *std.Io.Writer) !void {
std.debug.print("out pointer: {*}\n", .{out});
std.debug.print("writing pong\n", .{});
_ = try out.write("PONG\r\n");
try out.flush();
}
pub fn writeInfo(out: *std.Io.Writer, info: Message.ServerInfo) !void {
std.debug.print("writing info: {any}\n", .{info});
_ = try out.write("INFO ");
try std.json.Stringify.value(info, .{}, out);
_ = try out.write("\r\n");