-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Labels
type: featureIssues related to new features.Issues related to new features.
Milestone
Description
please add socket.io ack support
like
@OnMessage('some-message')
@ReturnAck()
action ( @ConnectedSocket() socket: SocketIO.Socket, @MessageBody() msg: any) {
return "aa"
}
@OnMessage('some-message-error')
@ReturnAck()
action2 ( @ConnectedSocket() socket: SocketIO.Socket, @MessageBody() msg: any) {
throw new Error('xxx')
}
// the logic is like next code:
socket.on('some-message',async (body:any,callback:(err: Error | null, ret?: any) => void){
try{
const ret = await action(body)
callback(null,ret)
}
catch(e){
callback(e)
}
}
mirnpnh and artem-itdim
Metadata
Metadata
Assignees
Labels
type: featureIssues related to new features.Issues related to new features.