Is it possible to do something like that with socket io :
socket.on('event.here', async (data) => {
const result:any = await webservice();
}
I'm not quite sure how to do it ?
Is it possible to do something like that with socket io :
socket.on('event.here', async (data) => {
const result:any = await webservice();
}
I'm not quite sure how to do it ?
Yes you can do it, but it depends on what you want to do. If you want to be able to await for some async operation inside callback than you are all set. But if you want for the next event to not fire before handling of previous one was finished than it won't work that way.
Here is a little simulation:
You can play with it here to get a feeling, in fact SocketIO has nothing to do with it being able to work.