Does onMessage support the acknowledgement callback?
Example 1:
@SubscribeMessage('events')
onEvent(client, data): WsResponse
const event = 'events';
return { event, data };
}
Example 2:
socket.on('news', (data, callback) => {
callback(0);
});
Hi @danapier,
By default - no, but you can do this easily using WsAdapter https://docs.nestjs.com/websockets/adapter
@danapier did you get this working somehow? I've been trying to implement the same thing myself but can't get it working.
I wrote this module over nestjs, which do it under the hood so you don't need to call ack callback explicitly, you only need to return value or throw error: https://www.npmjs.com/package/nestjs-socket-handlers-with-ack . Hope it helps
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I wrote this module over nestjs, which do it under the hood so you don't need to call ack callback explicitly, you only need to return value or throw error: https://www.npmjs.com/package/nestjs-socket-handlers-with-ack . Hope it helps