subscription: remove dangling old implementation

Missed this before the commit train left the station.
This commit is contained in:
torque 2023-08-15 20:11:38 -07:00
parent 79a45fd2e3
commit b55dfe0732
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk

View File

@ -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;
}