Initial commit
This commit is contained in:
12
README.md
Normal file
12
README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# React Server-Sent Events
|
||||
|
||||
This is a library to send SSE events to a browser using ReactPHP.
|
||||
|
||||
## Usage
|
||||
|
||||
1. When receiving a request, create a new `NoccyLabs\React\Sse\EventSource` object.
|
||||
2. Return the `ResponseInterface` object from `$es->response()` to the client.
|
||||
3. Send your events using `$es->sendMessage()` and `$es->sendEvent()`.
|
||||
4. Use `$es->close()` to terminate the connection.
|
||||
5. Listen for the `close` event to know when it it time to discard the instance.
|
||||
|
||||
Reference in New Issue
Block a user