Skip to content

Commit ab3cc90

Browse files
committed
Moving Event Buffer up to be next to "trigger"
Also adding example.
1 parent 3839a1a commit ab3cc90

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
Pusher REST Python library
2-
==========================
1+
# Pusher REST Python library
32

4-
![Travis-CI](https://travis-ci.org/pusher/pusher-rest-python.svg)
3+
![Travis-CI](https://travis-ci.org/pusher/pusher-http-python.svg)
54

65
*status: Alpha*
76

@@ -73,6 +72,20 @@ To trigger an event on one or more channels, use the `trigger` method on the `Pu
7372

7473
This call will trigger to `'a_channel'` and `'another_channel'`, and exclude the recipient with socket_id `"1234.12"`.
7574

75+
```python
76+
pusher.trigger([u'a_channel', u'another_channel'], u'an_event', {u'some': u'data'}, "1234.12")
77+
```
78+
79+
#### Event Buffer
80+
81+
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.
82+
83+
Note: this requires your Pusher application to be on a cluster that has the Event Buffer capability.
84+
85+
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.
86+
87+
##### Example
88+
7689
```python
7790
events = pusher.trigger([u'a_channel', u'another_channel'], u'an_event', {u'some': u'data'}, "1234.12")
7891

@@ -232,14 +245,6 @@ webhook = pusher.config.validate_webhook(
232245
print webhook["events"]
233246
```
234247

235-
## Event Buffer
236-
237-
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.
242-
243248
Running the tests
244249
-----------------
245250

0 commit comments

Comments
 (0)