ResponseBody
API reference › RoadRunner › ResponseBody
Retains failures from streaming read() and eof() calls that an emitter may consume.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | ResponseBody | |
__toString() | ResponseBody | |
close() | ResponseBody | |
detach() | ResponseBody | |
eof() | ResponseBody | |
getContents() | ResponseBody | |
getFailure() | Returns the failure even when the emitter returned normally after consuming it. | ResponseBody |
getMetadata() | ResponseBody | |
getSize() | ResponseBody | |
isReadable() | ResponseBody | |
isSeekable() | ResponseBody | |
isWritable() | ResponseBody | |
read() | ResponseBody | |
rewind() | ResponseBody | |
seek() | ResponseBody | |
tell() | ResponseBody | |
write() | ResponseBody |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(Psr\Http\Message\StreamInterface $stream)Parameters
| Parameter | Type | Description |
|---|---|---|
$stream | Psr\ |
close()
Section titled “close() ”public function close(): voidgetFailure()
Section titled “getFailure() ”public function getFailure(): Throwable|nullReturns the failure even when the emitter returned normally after consuming it.
Returns
Throwable|null
getMetadata()
Section titled “getMetadata() ”public function getMetadata(string|null $key = null): mixedParameters
| Parameter | Type | Description |
|---|---|---|
$key | string| |
Returns
mixed
read()
Section titled “read() ”public function read(int $length): stringParameters
| Parameter | Type | Description |
|---|---|---|
$length | int |
Returns
string
rewind()
Section titled “rewind() ”public function rewind(): voidseek()
Section titled “seek() ”public function seek(int $offset, int $whence = \yii2\extensions\roadrunner\SEEK_SET): voidParameters
| Parameter | Type | Description |
|---|---|---|
$offset | int | |
$whence | int |
write()
Section titled “write() ”public function write(string $string): intParameters
| Parameter | Type | Description |
|---|---|---|
$string | string |
Returns
int