Initial commit

This commit is contained in:
Christopher Vagnetoft
2026-03-01 01:11:48 +01:00
commit 1659492009
7 changed files with 1144 additions and 0 deletions

12
README.md Normal file
View 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.