cyclone.sse — Server-Sent Events

Server-sent events is a technology for providing push notifications from a server to a browser client in the form of DOM events.

For more information, check out the SEE demo.

class cyclone.sse.SSEHandler(application, request, **kwargs)[source]

Subclass this class and define bind and unbind to get notified when a new client connects or disconnects, respectively.

Once connected, you may send events to the browser via sendEvent.

sendEvent(message, event=None, eid=None, retry=None)[source]

sendEvent is the single method to send events to clients.

Parameters:

message: the event itself

event: optional event name

eid: optional event id to be used as Last-Event-ID header or
e.lastEventId property

retry: set the retry timeout in ms. default 3 secs.

bind()[source]

Gets called when a new client connects.

unbind()[source]

Gets called when an existing client disconnects.

Previous topic

cyclone.auth — Third-party login with OpenID and OAuth

Next topic

cyclone.xmlrpc — XML-encoded Remote Procedure Call

This Page