/** * {@inheritdoc} */ protected function doSendInternalRequests(array $internalRequests, $success, $error) { $requests = array(); foreach ($internalRequests as $internalRequest) { $requests[] = $this->createRequest($internalRequest, $success, $error); } class_exists('GuzzleHttp\\Pool') ? Pool::batch($this->client, $requests) : \GuzzleHttp\batch($this->client, $requests); }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Invalid event format */ public function testBatchValidatesTheEventFormat() { $client = new Client(); $requests = [$client->createRequest('GET', 'http://foo.com/baz')]; \GuzzleHttp\batch($client, $requests, ['complete' => 'foo']); }
public function batch($requests) { return \GuzzleHttp\batch($this->client, $requests); }