omatech/sse-client

Server Sent Event client implementation

0.1.5 2019-10-16 08:14 UTC

This package is auto-updated.

Last update: 2024-10-16 19:45:15 UTC


README

#PHP SSE Client

(ported from Python SSE client: https://bitbucket.org/btubbs/sseclient/)

This is a PHP client library for iterating over http Server Sent Event (SSE) streams (also known as EventSource, after the name of the Javascript interface inside browsers).

Example usage:

$client = new SseClient\Client('https://eventsource.firebaseio-demo.com/.json');

// returns generator
$events = $client->getEvents();

// blocks until new event arrive
foreach ($events as $event) {
    print_r($event);
}