From b55dfe073217bf8b7e23ce048e8eb92a745ef28d Mon Sep 17 00:00:00 2001 From: torque Date: Tue, 15 Aug 2023 20:11:38 -0700 Subject: [PATCH] subscription: remove dangling old implementation Missed this before the commit train left the station. --- src/subscription.zig | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/src/subscription.zig b/src/subscription.zig index a0580b9..ef07946 100644 --- a/src/subscription.zig +++ b/src/subscription.zig @@ -41,44 +41,3 @@ pub const Subscription = opaque { nats_c.natsSubscription_Destroy(@ptrCast(self)); } }; - -// pub fn Subscription(T: type) type { -// return struct { -// const Self = @This(); - -// _internal: *nats_c.natsSubscription, -// userdata: T, -// function: MessageCallback(T), - -// pub fn create( -// allocator: std.mem.Allocator, -// userdata: T, -// callback: MessageCallback(T), -// ) AllocError!*Self { -// const self: *Self = try std.mem.Allocator.create(Self); -// self.userdata = userdata; -// self.function = callback; -// return self; -// } - -// pub fn wrap( -// self: *Self, -// internal: *nats_c.natsSubscription, -// ) void { -// // self._internal = -// } - -// fn thunk( -// conn: ?*nats_c.natsConnection, -// sub: ?*nats_c.natsSubscription, -// msg: ?*nats_c.natsMsg, -// userdata: ?*const anyopaque, -// ) callconv(.C) void { -// self.function(self.userdata, connection, subscription, message); -// } -// }; -// } - -pub fn MessageCallback(comptime T: type) type { - return *const fn (userdata: T, connection: *Connection, subscription: *Subscription, message: *Message) void; -}