You are here

public function PumpStream::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/psr7/src/PumpStream.php \GuzzleHttp\Psr7\PumpStream::__construct()

Parameters

callable $source Source of the stream data. The callable MAY: accept an integer argument used to control the amount of data to return. The callable MUST return a string when called, or false on error or EOF.

array $options Stream options::

  • metadata: Hash of metadata to use with stream.
  • size: Size of the stream, if known.

File

vendor/guzzlehttp/psr7/src/PumpStream.php, line 43

Class

PumpStream
Provides a read only stream that pumps data from a PHP callable.

Namespace

GuzzleHttp\Psr7

Code

public function __construct(callable $source, array $options = []) {
  $this->source = $source;
  $this->size = isset($options['size']) ? $options['size'] : null;
  $this->metadata = isset($options['metadata']) ? $options['metadata'] : [];
  $this->buffer = new BufferStream();
}