You are here

private static function Pool::cmpCallback in Lockr 7.3

1 call to Pool::cmpCallback()
Pool::batch in vendor/guzzlehttp/guzzle/src/Pool.php
Sends multiple requests concurrently and returns an array of responses and exceptions that uses the same ordering as the provided requests.

File

vendor/guzzlehttp/guzzle/src/Pool.php, line 109

Class

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

Namespace

GuzzleHttp

Code

private static function cmpCallback(array &$options, $name, array &$results) {
  if (!isset($options[$name])) {
    $options[$name] = function ($v, $k) use (&$results) {
      $results[$k] = $v;
    };
  }
  else {
    $currentFn = $options[$name];
    $options[$name] = function ($v, $k) use (&$results, $currentFn) {
      $currentFn($v, $k);
      $results[$k] = $v;
    };
  }
}