public function sendAll(Iterator $transactions, $parallel) { foreach ($transactions as $transaction) { try { $this->adapter->send($transaction); } catch (puzzle_exception_RequestException $e) { if ($e->getThrowImmediately()) { throw $e; } } } }
public function send(puzzle_message_RequestInterface $request) { $transaction = new puzzle_adapter_Transaction($this, $request); try { if ($response = $this->adapter->send($transaction)) { return $response; } throw new LogicException('No response was associated with the transaction'); } catch (puzzle_exception_RequestException $e) { throw $e; } catch (Exception $e) { // Wrap exceptions in a puzzle_exception_RequestException to adhere to the interface throw new puzzle_exception_RequestException($e->getMessage(), $request, null, $e); } }