scratch – Blame information for rev 87

Subversion Repositories:
Rev:
Rev Author Line No. Line
87 office 1 <?php
2 namespace GuzzleHttp\Adapter;
3  
4 use GuzzleHttp\Exception\RequestException;
5  
6 /**
7 * Decorates a regular AdapterInterface object and creates a
8 * ParallelAdapterInterface object that sends multiple HTTP requests serially.
9 */
10 class FakeParallelAdapter implements ParallelAdapterInterface
11 {
12 /** @var AdapterInterface */
13 private $adapter;
14  
15 /**
16 * @param AdapterInterface $adapter Adapter used to send requests
17 */
18 public function __construct(AdapterInterface $adapter)
19 {
20 $this->adapter = $adapter;
21 }
22  
23 public function sendAll(\Iterator $transactions, $parallel)
24 {
25 foreach ($transactions as $transaction) {
26 try {
27 $this->adapter->send($transaction);
28 } catch (RequestException $e) {
29 if ($e->getThrowImmediately()) {
30 throw $e;
31 }
32 }
33 }
34 }
35 }