With event
method you're able to:
- Publish global events to which other sockets can subscribe
const {event} = new Server(ctx)
Name | Description |
---|---|
event.publish | Publish global event |
Type | Name | Default | Description |
---|---|---|---|
string | name | null | Event name |
object | payload | null | Additional data passed with event |
event.emit('email_sent', {to: '[email protected]'})
event_handlers:
events.socket_name.email_sent:
file: email-sent.js