# Path: pushkin/context.py
# PERSIST_LOGGER_PREFFIX = 'persist_'
# def setup_loggers():
# def setup_configuration(configuration_filename):
# def start_processors():


import tornado.web
import httplib
import abc
from pushkin import context
                "Request could not be parsed in batch handler {}!".format(self.__class__.__name__))
            raise tornado.web.HTTPError(400)

    def post(self):
        self.handle_request()

    @abc.abstractmethod
    def init_input_format(self, body):
        """Create batch proto object."""
        raise NotImplementedError

    @abc.abstractmethod
    def unpack_batch(self, request):
        """Get request proto list from batch proto."""
        raise NotImplementedError

    @abc.abstractmethod
    def create_request(self, requests):
        """Create request to encapsulate proto_requests objects.
        Passed to RequestProcessor.
        """
        raise NotImplementedError

    def handle_request(self):
        parsed_request = self.parse_request(self.request.body)
        unpacked_requests = self.unpack_batch(parsed_request)
        context.main_logger.debug("Received an event batch of {num_requests} requests in batch handler {handler}"
                                  .format(num_requests=len(unpacked_requests),
                                          handler=self.__class__.__name__))


# Path: pushkin/context.py
# PERSIST_LOGGER_PREFFIX = 'persist_'
# def setup_loggers():
# def setup_configuration(configuration_filename):
# def start_processors():


# Path: pushkin/requesthandlers/batch.py
import tornado.web
import httplib
import abc
from pushkin import context

                "Request could not be parsed in batch handler {}!".format(self.__class__.__name__))
            raise tornado.web.HTTPError(400)

    def post(self):
        self.handle_request()

    @abc.abstractmethod
    def init_input_format(self, body):
        """Create batch proto object."""
        raise NotImplementedError

    @abc.abstractmethod
    def unpack_batch(self, request):
        """Get request proto list from batch proto."""
        raise NotImplementedError

    @abc.abstractmethod
    def create_request(self, requests):
        """Create request to encapsulate proto_requests objects.
        Passed to RequestProcessor.
        """
        raise NotImplementedError

    def handle_request(self):
        parsed_request = self.parse_request(self.request.body)
        unpacked_requests = self.unpack_batch(parsed_request)
        context.main_logger.debug("Received an event batch of {num_requests} requests in batch handler {handler}"
                                  .format(num_requests=len(unpacked_requests),
                                          handler=self.__class__.__name__))


        if not context.request_processor.submit(self.create_request(unpacked_requests)):