class IterableStreamedResponse extends StreamedResponse

Retain iterable chunks so the Swoole bridge can stop production after a failed write.

Methods

__construct(iterable $chunks, int $status = 200, array $headers = [])

Create a new iterable streamed response.

setChunks(iterable $chunks)

Set the chunks associated with the response.

setCallback(callable $callback)

Set the callback associated with the response.

sendContent()

Send the response content.

bool
streamTo(Closure $write)

Stream retained chunks through the given writer.

Details

at line 27
__construct(iterable $chunks, int $status = 200, array $headers = [])

Create a new iterable streamed response.

Parameters

iterable $chunks
int $status
array $headers

at line 39
IterableStreamedResponse setChunks(iterable $chunks)

Set the chunks associated with the response.

Parameters

iterable $chunks

Return Value

IterableStreamedResponse

at line 50
IterableStreamedResponse setCallback(callable $callback)

Set the callback associated with the response.

Parameters

callable $callback

Return Value

IterableStreamedResponse

at line 61
IterableStreamedResponse sendContent()

Send the response content.

at line 88
bool streamTo(Closure $write)

internal  
 

Stream retained chunks through the given writer.

Parameters

Closure $write

Return Value

bool