IEventSource
in
Wrapper for Server-Sent Events (SSE).
Use SSE with caution: too many concurrent open requests can overload or stall the server.
The connection is opened lazily when the first event is sent.
Tags
Table of Contents
Methods
Methods
close()
Closes the SSE connection.
public
close() : void
Tags
send()
Sends an event to the client.
public
send(string $type[, mixed $data = null ]) : void
Parameters
- $type : string
-
Event type/name.
- $data : mixed = null
-
Event payload.
If only one argument is provided, it is sent as a typeless payload (legacy behavior).