[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/guzzlehttp/guzzle/src/ -> Pool.php (summary)

(no description)

File Size: 333 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Pool:: (13 methods):
  __construct()
  batch()
  send()
  getPoolSize()
  addNextRequests()
  wait()
  cancel()
  then()
  promise()
  coerceIterable()
  addNextRequest()
  _trackRetries()
  finishResponse()


Class: Pool  - X-Ref

Sends and iterator of requests concurrently using a capped pool size.

The Pool object implements FutureInterface, meaning it can be used later
when necessary, the requests provided to the pool can be cancelled, and
you can check the state of the pool to know if it has been dereferenced
(sent) or has been cancelled.

When sending the pool, keep in mind that no results are returned: callers
are expected to handle results asynchronously using Guzzle's event system.
When requests complete, more are added to the pool to ensure that the
requested pool size is always filled as much as possible.

IMPORTANT: Do not provide a pool size greater that what the utilized
underlying RingPHP handler can support. This will result is extremely poor
performance.
__construct(ClientInterface $client,$requests,array $options = [])   X-Ref
The option values for 'before', 'complete', 'error' and 'end' can be a
callable, an associative array containing event data, or an array of
event data arrays. Event data arrays contain the following keys:

- fn: callable to invoke that receives the event
- priority: Optional event priority (defaults to 0)
- once: Set to true so that the event is removed after it is triggered

param: ClientInterface $client   Client used to send the requests.
param: array|\Iterator $requests Requests to send in parallel
param: array           $options  Associative array of options

batch(ClientInterface $client,$requests,array $options = [])   X-Ref
Sends multiple requests in parallel and returns an array of responses
and exceptions that uses the same ordering as the provided requests.

IMPORTANT: This method keeps every request and response in memory, and
as such, is NOT recommended when sending a large number or an
indeterminate number of requests concurrently.

param: ClientInterface $client   Client used to send the requests
param: array|\Iterator $requests Requests to send in parallel
param: array           $options  Passes through the options available in
return: BatchResults Returns a container for the results.

send(ClientInterface $client,$requests,array $options = [])   X-Ref
Creates a Pool and immediately sends the requests.

param: ClientInterface $client   Client used to send the requests
param: array|\Iterator $requests Requests to send in parallel
param: array           $options  Passes through the options available in

getPoolSize()   X-Ref
No description

addNextRequests()   X-Ref
Add as many requests as possible up to the current pool limit.


wait()   X-Ref
No description

cancel()   X-Ref
{@inheritdoc}

Attempt to cancel all outstanding requests (requests that are queued for
dereferencing). Returns true if all outstanding requests can be
cancelled.

return: bool

then(callable $onFulfilled = null,callable $onRejected = null,callable $onProgress = null)   X-Ref
Returns a promise that is invoked when the pool completed. There will be
no passed value.

{@inheritdoc}

promise()   X-Ref
No description

coerceIterable($requests)   X-Ref
No description

addNextRequest()   X-Ref
Adds the next request to pool and tracks what requests need to be
dereferenced when completing the pool.


_trackRetries(BeforeEvent $e)   X-Ref
No description

finishResponse($request, $value, $hash)   X-Ref
No description



Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1