class HttpRequestPool implements Countable, Iterator (View source)

Methods

__construct(HttpRequest|null $request = null)

(PECL pecl_http >= 0.10.0)
HttpRequestPool constructor

void
__destruct()

(PECL pecl_http >= 0.10.0)
HttpRequestPool destructor

bool
attach(HttpRequest $request)

(PECL pecl_http >= 0.10.0)
Attach HttpRequest

bool
detach(HttpRequest $request)

(PECL pecl_http >= 0.10.0)
Detach HttpRequest

bool
send()

(PECL pecl_http >= 0.10.0)
Send all requests

void
reset()

(PECL pecl_http >= 0.10.0)
Reset request pool

bool
socketPerform()

(PECL pecl_http >= 0.15.0)
Perform socket actions

bool
socketSelect()

(PECL pecl_http >= 0.10.0)
Perform socket select

bool
valid()

Checks if current position is valid

mixed
current()

Return the current element

mixed
key()

Return the key of the current element

void
next()

Move forward to next element

void
rewind()

Rewind the Iterator to the first element

int
count()

Count elements of an object

array
getAttachedRequests()

(PECL pecl_http >= 0.16.0)
Get attached requests

array
getFinishedRequests()

(PECL pecl_http >= 0.16.0)
Get finished requests

enablePipelining($enable)

No description

enableEvents($enable)

No description

Details

__construct(HttpRequest|null $request = null)

(PECL pecl_http >= 0.10.0)
HttpRequestPool constructor

Parameters

HttpRequest|null $request

[optional]

HttpRequest object to attach

void __destruct()

(PECL pecl_http >= 0.10.0)
HttpRequestPool destructor

Return Value

void

bool attach(HttpRequest $request)

(PECL pecl_http >= 0.10.0)
Attach HttpRequest

Parameters

HttpRequest $request

an HttpRequest object not already attached to any HttpRequestPool object

Return Value

bool

true on success or false on failure.

bool detach(HttpRequest $request)

(PECL pecl_http >= 0.10.0)
Detach HttpRequest

Parameters

HttpRequest $request

an HttpRequest object attached to this HttpRequestPool object

Return Value

bool

true on success or false on failure.

bool send()

(PECL pecl_http >= 0.10.0)
Send all requests

Return Value

bool

true on success or false on failure.

void reset()

(PECL pecl_http >= 0.10.0)
Reset request pool

Return Value

void

protected bool socketPerform()

(PECL pecl_http >= 0.15.0)
Perform socket actions

Return Value

bool

TRUE until each request has finished its transaction.

protected bool socketSelect()

(PECL pecl_http >= 0.10.0)
Perform socket select

Return Value

bool

true on success or false on failure.

bool valid()

Checks if current position is valid

Return Value

bool

The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

mixed current()

Return the current element

Return Value

mixed

Can return any type.

mixed key()

Return the key of the current element

Return Value

mixed

TKey on success, or null on failure.

void next()

Move forward to next element

Return Value

void

Any returned value is ignored.

void rewind()

Rewind the Iterator to the first element

Return Value

void

Any returned value is ignored.

int count()

Count elements of an object

Return Value

int

The custom count as an integer.

The return value is cast to an integer.

array getAttachedRequests()

(PECL pecl_http >= 0.16.0)
Get attached requests

Return Value

array

an array containing all currently attached HttpRequest objects.

array getFinishedRequests()

(PECL pecl_http >= 0.16.0)
Get finished requests

Return Value

array

an array containing all attached HttpRequest objects that already have finished their work.

enablePipelining($enable)

No description

Parameters

$enable [optional]

enableEvents($enable)

No description

Parameters

$enable [optional]