protected function prepareResponse($response, CassandraEvent $event = null)
    {
        if (is_null($event)) {
            return $response;
        }

        if ($response instanceof Future) {
            return new FutureResponse($response, $event, $this->eventDispatcher);
        }

        $event->setExecutionStop();
        $this->eventDispatcher->dispatch(CassandraEvent::EVENT_NAME, $event);

        return $response;
    }
protected function prepareResponse($response, CassandraEvent $event = null)
    {
        if (is_null($event)) {
            return $response;
        }

        if ($response instanceof Future) {
            return new FutureResponse($response, $event, $this->eventDispatcher);
        }

        $event->setExecutionStop();
        $this->eventDispatcher->dispatch(CassandraEvent::EVENT_NAME, $event);

        return $response;
    }
protected function prepareResponse ( $ response , CassandraEvent $ event = null ) { if ( is_null ( $ event ) ) { return $ response ; } if ( $ response instanceof Future ) { return new FutureResponse ( $ response , $ event , $ this -> eventDispatcher ) ; } $ event -> setExecutionStop ( ) ; $ this -> eventDispatcher -> dispatch ( CassandraEvent :: EVENT_NAME , $ event ) ; return $ response ; }
Prepare response to return

@param mixed               $response
@param CassandraEvent|null $event

@return mixed
Prepare response to return