server: remove unused sendLater

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-10-09 01:00:12 +02:00
parent f9b097794f
commit 15414f5ee4

View File

@@ -317,16 +317,6 @@ const Send = struct {
self.ctx.alloc().destroy(self); self.ctx.alloc().destroy(self);
} }
fn laterCbk(self: *Send, completion: *Completion, result: TimeoutError!void) void {
std.log.debug("sending after", .{});
_ = result catch |err| {
self.ctx.err = err;
return;
};
self.ctx.loop.io.send(*Send, self, Send.asyncCbk, completion, self.ctx.socket, self.buf);
}
fn asyncCbk(self: *Send, completion: *Completion, result: SendError!usize) void { fn asyncCbk(self: *Send, completion: *Completion, result: SendError!usize) void {
const size = result catch |err| { const size = result catch |err| {
self.ctx.err = err; self.ctx.err = err;
@@ -338,11 +328,6 @@ const Send = struct {
} }
}; };
pub fn sendLater(ctx: *Ctx, msg: []const u8, ns: u63) !void {
const sd = try Send.init(ctx, msg);
ctx.loop.io.timeout(*Send, sd.ctx, Send.laterCbk, sd.completion, ns);
}
pub fn sendAsync(ctx: *Ctx, msg: []const u8) !void { pub fn sendAsync(ctx: *Ctx, msg: []const u8) !void {
const sd = try Send.init(ctx, msg); const sd = try Send.init(ctx, msg);
ctx.loop.io.send(*Send, sd.ctx, Send.asyncCbk, sd.completion, ctx.conn_socket, msg); ctx.loop.io.send(*Send, sd.ctx, Send.asyncCbk, sd.completion, ctx.conn_socket, msg);