React\Stream\Buffer::__construct PHP Method

__construct() public method

public __construct ( $stream, React\EventLoop\LoopInterface $loop )
$loop React\EventLoop\LoopInterface
    public function __construct($stream, LoopInterface $loop)
    {
        if (!is_resource($stream) || get_resource_type($stream) !== "stream") {
            throw new \InvalidArgumentException('First parameter must be a valid stream resource');
        }
        $this->stream = $stream;
        $this->loop = $loop;
    }