/**
  * On multi request sent event.
  *
  * @param \Ivory\HttpAdapter\Event\MultiRequestSentEvent $event The multi request sent event.
  */
 public function onMultiRequestSent(MultiRequestSentEvent $event)
 {
     $redirectRequests = array();
     foreach ($event->getResponses() as $response) {
         try {
             $redirectRequest = $this->redirect->createRedirectRequest($response, $response->getParameter('request'), $event->getHttpAdapter());
         } catch (HttpAdapterException $e) {
             $event->removeResponse($response);
             $event->addException($e);
             continue;
         }
         if ($redirectRequest === false) {
             $event->removeResponse($response);
             $event->addResponse($this->redirect->prepareResponse($response, $response->getParameter('request')));
         } else {
             $redirectRequests[] = $redirectRequest;
             $event->removeResponse($response);
         }
     }
     if (empty($redirectRequests)) {
         return;
     }
     try {
         $event->addResponses($event->getHttpAdapter()->sendRequests($redirectRequests));
     } catch (MultiHttpAdapterException $e) {
         $event->addResponses($e->getResponses());
         $event->addExceptions($e->getExceptions());
     }
 }
 /**
  * On multi request sent event.
  *
  * @param \Ivory\HttpAdapter\Event\MultiRequestSentEvent $event The multi request sent event.
  */
 public function onMultiRequestSent(MultiRequestSentEvent $event)
 {
     foreach ($event->getResponses() as $response) {
         if (!$this->statusCode->validate($response)) {
             $event->addException($this->createStatusCodeException($response, $response->getParameter('request'), $event->getHttpAdapter()));
             $event->removeResponse($response);
         }
     }
 }