HumHub Documentation (unofficial)

AsyncContext
in package

FinalYes

A DTO to work with AsyncResponse.

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

Properties

$client  : mixed
$content  : mixed
$info  : mixed
$offset  : mixed
$passthru  : mixed
$response  : mixed

Methods

__construct()  : mixed
cancel()  : ChunkInterface
Cancels the request and returns the last chunk to yield.
createChunk()  : ChunkInterface
Creates a new chunk of content.
getContent()  : resource|null
getHeaders()  : array<string|int, mixed>
Returns the headers without consuming the response.
getInfo()  : mixed
Returns the current info of the response.
getResponse()  : ResponseInterface
Returns the currently processed response.
getStatusCode()  : int
Returns the HTTP status without consuming the response.
passthru()  : void
Replaces or removes the chunk filter iterator.
pause()  : void
Pauses the request for the given number of seconds.
replaceRequest()  : ResponseInterface
Replaces the currently processed response by doing a new request.
replaceResponse()  : ResponseInterface
Replaces the currently processed response by another one.
setInfo()  : $this
Attaches an info to the response.

Properties

Methods

getContent()

public getContent() : resource|null
Return values
resource|null

The PHP stream resource where the content is buffered, if it is

getHeaders()

Returns the headers without consuming the response.

public getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

getInfo()

Returns the current info of the response.

public getInfo([string|null $type = null ]) : mixed
Parameters
$type : string|null = null

getStatusCode()

Returns the HTTP status without consuming the response.

public getStatusCode() : int
Return values
int

passthru()

Replaces or removes the chunk filter iterator.

public passthru([callable(ChunkInterface, self): Array|null $passthru = null ]) : void
Parameters
$passthru : callable(ChunkInterface, self): Array|null = null

pause()

Pauses the request for the given number of seconds.

public pause(float $duration) : void
Parameters
$duration : float

replaceRequest()

Replaces the currently processed response by doing a new request.

public replaceRequest(string $method, string $url[, array<string|int, mixed> $options = [] ]) : ResponseInterface
Parameters
$method : string
$url : string
$options : array<string|int, mixed> = []
Return values
ResponseInterface

setInfo()

Attaches an info to the response.

public setInfo(string $type, mixed $value) : $this
Parameters
$type : string
$value : mixed
Return values
$this

        
On this page

Search results