You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To trigger an event on one or more channels, use the `trigger` method on the `Pusher` object.
58
+
59
+
#### `Pusher::trigger`
60
+
61
+
|Argument |Description |
62
+
|:-:|:-:|
63
+
|channels `String` or `Collection`|**Required** <br> The name or list of names of the channel you wish to trigger events on |
64
+
|event `String`|**Required** <br> The name of the event you wish to trigger. |
65
+
|data `JSONable data`|**Required** <br> The event's payload |
66
+
|socket_id `String`|**Default:`None`** <br> The socket_id of the connection you wish to exclude from receiving the event. You can read more [here](http://pusher.com/docs/duplicates). |
67
+
68
+
|Return Values |Description |
69
+
|:-:|:-:|
70
+
|buffered_events `Dict`| A parsed response that includes the event_id for each event published to a channel. See example. |
71
+
72
+
##### Example
59
73
60
-
You can also specify `socket_id` as a separate argument, as described in
61
-
<http://pusher.com/docs/duplicates>. This will excluded the connection with that socket_id from receiving the event:
74
+
This call will trigger to `'a_channel'` and `'another_channel'`, and exclude the recipient with socket_id `"1234.12"`.
Version 1.0.0 of the library introduced support for event buffering. The purpose of this functionality is to ensure that events that are triggered during whilst a client is offline for a short period of time will still be delivered upon reconnection.
238
+
239
+
Note: this requires your Pusher application to be on a cluster that has the Event Buffer capability.
240
+
241
+
As part of this the trigger function now returns a set of event_id values for each event triggered on a channel. These can then be used by the client to tell the Pusher service the last event it has received. If additional events have been triggered after that event ID the service has the opportunity to provide the client with those IDs.
0 commit comments