Stream
Less than 1 minute
Stream
Stream response class.
class Stream extends \Hazaar\Controller\Response\OKThis response emits lightweight framed stream packets for incremental output. Payloads can represent plain strings, arrays encoded as JSON, or exception details encoded as structured error packets.
Packet framing uses a one-byte type marker and content payload, with writePacket() additionally prefixing a hexadecimal payload length.
Properties
type
Stream packet type marker.
private string $type = 's'Known values are:
sfor plain string payloadsafor array/JSON payloadsefor error payloads
Methods
__construct
public __construct(string $data): voidParameters
| Parameter | Type | Description |
|---|---|---|
$data | string |
writePacket
Write a framed stream packet with a hexadecimal length prefix.
public writePacket(): voidPacket format: <hex-length>\0<type><payload>. The output buffers are flushed immediately to support streaming clients.
writeOutput
Write the stream payload without a length prefix.
public writeOutput(): voidPacket format: \0<type><payload>.
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000