|[ Index ]||
PHP Cross Reference of phpBB-3.2.11-deutsch
|File Size:||207 lines (8 kb)|
|Included or required:||0 times|
|Includes or requires:||0 files|
|__construct(StreamInterface $buffer,array $config = ) X-Ref|
|In order to utilize high water marks to tell writers to slow down, the|
provided stream must answer to the "hwm" stream metadata variable,
providing the high water mark. If no "hwm" metadata value is available,
then the "drain" functionality is not utilized.
This class accepts an associative array of configuration options.
- drain: (callable) Function to invoke when the stream has drained,
meaning the buffer is now writable again because the size of the
buffer is at an acceptable level (e.g., below the high water mark).
The function accepts a single argument, the buffer stream object that
- pump: (callable) A function that accepts the number of bytes to read
from the source stream. This function will block until all of the data
that was requested has been read, EOF of the source stream, or the
source stream is closed.
- size: (int) The expected size in bytes of the data that will be read
(if known up-front).
param: StreamInterface $buffer Buffer that contains the data that has
param: array $config Associative array of options.
|create(array $options = ) X-Ref|
|Factory method used to create new async stream and an underlying buffer|
if no buffer is provided.
This function accepts the same options as AsyncReadStream::__construct,
but added the following key value pairs:
- buffer: (StreamInterface) Buffer used to buffer data. If none is
provided, a default buffer is created.
- hwm: (int) High water mark to use if a buffer is created on your
- max_buffer: (int) If provided, wraps the utilized buffer in a
DroppingStream decorator to ensure that buffer does not exceed a given
length. When exceeded, the stream will begin dropping data. Set the
max_buffer to 0, to use a NullStream which does not store data.
- write: (callable) A function that is invoked when data is written
to the underlying buffer. The function accepts the buffer as the first
argument, and the data being written as the second. The function MUST
return the number of bytes that were written or false to let writers
know to slow down.
- drain: (callable) See constructor documentation.
- pump: (callable) See constructor documentation.
param: array $options Associative array of options.
return: array Returns an array containing the buffer used to buffer
|Generated: Wed Nov 11 20:33:01 2020||Cross-referenced by PHPXref 0.7.1|