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;
    }