EventSource

Implements \OCP\IEventSource

Class EventSource

Wrapper for server side events (http://en.wikipedia.org/wiki/Server-sent_events)

This version is tailored for the Gallery app, do not use elsewhere!

link

https://github.com/owncloud/core/blob/master/lib/private/eventsource.php

todo

Replace with a library

package

OCA\Gallery\Controller

Methods

Closes the connection of the event source

close() 

It's best to let the client close the stream

init

init() 

Sends a message to the client

send(string $type, mixed $data = null) 

If only one parameter is given, a typeless message will be sent with that parameter as data

Throws
\BadMethodCallException

Arguments

$type

string

$data

mixed

Makes sure we have a message we can use

validateMessage(string $type, mixed $data) 

Arguments

$type

string

$data

mixed

Properties

started

started : boolean
var

Type(s)

boolean