How to "emit" an event from the plugin with callback
Solved
Technical Support
-
Hello,
I am trying to emit(event, payload, callback) from the plugin, but I am getting "Error: Callbacks are not supported when broadcasting". Without the callback the event does propagate.
From the client however, the emit with callback works without a problem.
Anyone knows the proper way to do this?
Thanks,
JJ. -
@jjsagan what context is this in?
-
You are broadcasting, sending to multiple sockets. So there is no callback.
The client only sends to one socket, the server, so you get a callback.
If you need to send data back to the server, then emit another event from the client.
You should give more details, there's probably a better way to do what you need.
Copyright © 2024 NodeBB | Contributors