2017 © Pedro Peláez
 

library eventsource

The Hoa\Eventsource library.

image

hoa/eventsource

The Hoa\Eventsource library.

  • Tuesday, January 10, 2017
  • by Hoa
  • Repository
  • 16 Watchers
  • 76 Stars
  • 7,965 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 17 Forks
  • 1 Open issues
  • 15 Versions
  • 23 % Grown

The README.md

Hoa , (*1)


Build status Code coverage Packagist License , (*2)

Hoa is a modular, extensible and structured set of PHP libraries.
Moreover, Hoa aims at being a bridge between industrial and research worlds. , (*3)

Hoa\Eventsource

Help on IRC Help on Gitter Documentation Board, (*4)

This library allows to manipulate the EventSource (aka Server-Sent Events) technology by creating a server., (*5)

Learn more., (*6)

Installation

With Composer, to include this library into your dependencies, you need to require hoa/eventsource:, (*7)

$ composer require hoa/eventsource '~3.0'

For more installation procedures, please read the Source page., (*8)

Testing

Before running the test suites, the development dependencies must be installed:, (*9)

$ composer install

Then, to run all the test suites:, (*10)

$ vendor/bin/hoa test:run

For more information, please read the contributor guide., (*11)

Quick usage

We propose as a quick overview to send an unlimited number of events from the server to the client. The client will display all received events. Thus, in Server.php:, (*12)

$server = new Hoa\Eventsource\Server();

while (true) {
    // “tick” is the event name.
    $server->tick->send(time());
    sleep(1);
}

And in index.html, our client:, (*13)











Start your HTTP server and then open index.html., (*14)

The Hoa\Eventsource\Server::setReconnectionTime method allows to redefine the time before the client will reconnect after a disconnection. The Hoa\Eventsource\Server::getLastId method allows to retrieve the last ID sent to the client., (*15)

Awecode

The following awecodes show this library in action:, (*16)

  • Hoa\Eventsource: why and how to use Hoa\Eventsource\Server? A simple and daily useful example will illustrate the EventSource technology (or Server-Send Events).

Documentation

The hack book of Hoa\Eventsource contains detailed information about how to use this library and how it works., (*17)

To generate the documentation locally, execute the following commands:, (*18)

$ composer require --dev hoa/devtools
$ vendor/bin/hoa devtools:documentation --open

More documentation can be found on the project's website: hoa-project.net., (*19)

Getting help

There are mainly two ways to get help:, (*20)

Contribution

Do you want to contribute? Thanks! A detailed contributor guide explains everything you need to know., (*21)

License

Hoa is under the New BSD License (BSD-3-Clause). Please, see LICENSE for details., (*22)

The Versions

10/01 2017

dev-master

9999999-dev https://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

10/01 2017

3.17.01.10

3.17.01.10 https://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

19/11 2016

3.16.11.19

3.16.11.19 https://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

14/01 2016

3.16.01.14

3.16.01.14 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

11/01 2016

3.16.01.11

3.16.01.11 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

13/08 2015

2.15.08.13

2.15.08.13 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

29/05 2015

2.15.05.29

2.15.05.29 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

13/04 2015

2.15.04.13

2.15.04.13 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

19/02 2015

2.15.02.19

2.15.02.19 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

09/12 2014

2.14.12.10

2.14.12.10 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

25/11 2014

2.14.11.26

2.14.11.26 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library server http event push eventsource

05/10 2014

2.14.11.09

2.14.11.09 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

library server http event push eventsource

23/09 2014

2.14.09.23

2.14.09.23 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

library server http event push eventsource

17/09 2014

2.14.09.17

2.14.09.17 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

library server http event push eventsource

16/09 2014

1.14.09.16

1.14.09.16 http://hoa-project.net/

The Hoa\Eventsource library.

  Sources   Download

BSD-3-Clause

The Requires

 

library server http event push eventsource