IterableStreamedResponse
class IterableStreamedResponse extends StreamedResponse
Retain iterable chunks so the Swoole bridge can stop production after a failed write.
Properties
| protected bool | $cancelOnDisconnect |
Methods
Create a new iterable streamed response.
Cancel response production when the client connection closes.
Determine whether disconnects should cancel response production.
Set the chunks associated with the response.
Set the callback associated with the response.
Send the response content.
Details
at line 29
__construct(iterable $chunks, int $status = 200, array $headers = [])
Create a new iterable streamed response.
at line 39
IterableStreamedResponse
cancelOnDisconnect(bool $cancel = true)
Cancel response production when the client connection closes.
at line 49
bool
shouldCancelOnDisconnect()
Determine whether disconnects should cancel response production.
at line 59
IterableStreamedResponse
setChunks(iterable $chunks)
Set the chunks associated with the response.
at line 70
IterableStreamedResponse
setCallback(callable $callback)
Set the callback associated with the response.
at line 81
IterableStreamedResponse
sendContent()
Send the response content.
at line 108
bool
streamTo(Closure $write)
| internal |
Stream retained chunks through the given writer.