RingoJS

Module ringo/httpserver/eventsource

Class EventSource

Instance Methods

Instance Properties


EventSource

Provides support for EventSource in the HTTP server.

EventSource is an event emitter that supports the following events:

  • open: called when a new eventsource connection is accepted
  • close: called when an established eventsource connection closes

EventSource.prototype. close

Closes the EventSource connection.


EventSource.prototype. comment (msg)

Send a comment

Parameters

String msg

a string


EventSource.prototype. data (msg)

Send a default event to the client

Parameters

String msg

a string


EventSource.prototype. event (name, msg)

Send a named event

Parameters

String name

a string

String msg

a string