public function testCanCloseAll()
 {
     $m = curl_multi_init();
     $b = new puzzle_adapter_curl_BatchContext($m, true);
     $h = curl_init();
     $t = new puzzle_adapter_Transaction(new puzzle_Client(), new puzzle_message_Request('GET', 'http://httbin.org'));
     $b->addTransaction($t, $h);
     $b->removeAll();
     $this->assertFalse($b->isActive());
     $this->assertEquals(0, count($this->readAttribute($b, 'handles')));
     curl_multi_close($m);
 }
Exemple #2
0
 private function retryFailedConnection(puzzle_adapter_TransactionInterface $transaction, puzzle_adapter_curl_BatchContext $context)
 {
     // Add the request back to the batch to retry automatically.
     $context->addTransaction($transaction, $this->curlFactory->__invoke($transaction, $this->messageFactory));
 }