# Path: pq/utils/serializers.py
# def serializer(cls):
#     def __new__(cls, name, bases, attrs):
#     def consumer(cls):
#     def get(self, name):
#     def tojson(self):
#     def __init__(self, *args, **kwargs):
#     def decode(cls, data):
#     def encode(cls, message):
#         def decode(cls, data):
#         def encode(cls, message):
# def queue_message(d, type=None):
#     def default(self, o):
# def as_message(o):
# class MessageMetaClass(type):
# class Message(metaclass=MessageMetaClass):
# class MessageDict(Message):
# class Json:
#     class MsgPack:
# class JSONEncoder(json.JSONEncoder):


from abc import ABC, abstractmethod
from asyncio import Future, ensure_future
from collections import OrderedDict
from pulsar.api import chain_future, ImproperlyConfigured
from pulsar.apps.http import HttpClient
from pulsar.apps.greenio import GreenPool
from pulsar.apps.data.channels import Connector
from pulsar.utils.importer import module_attribute
from .utils.serializers import serializers




class MessageFuture(Future):

    def __init__(self, message_id, backend, *, loop=None):
        super().__init__(loop=loop)
        self.message_id = message_id
        self.backend = backend

    def wait(self):     # pragma    nocover
        assert not self._loop.is_running(), 'cannot wait if loop is running'
        return self._loop.run_until_complete(_wait(self))


# Path: pq/utils/serializers.py
# def serializer(cls):
#     def __new__(cls, name, bases, attrs):
#     def consumer(cls):
#     def get(self, name):
#     def tojson(self):
#     def __init__(self, *args, **kwargs):
#     def decode(cls, data):
#     def encode(cls, message):
#         def decode(cls, data):
#         def encode(cls, message):
# def queue_message(d, type=None):
#     def default(self, o):
# def as_message(o):
# class MessageMetaClass(type):
# class Message(metaclass=MessageMetaClass):
# class MessageDict(Message):
# class Json:
#     class MsgPack:
# class JSONEncoder(json.JSONEncoder):


# Path: pq/mq.py
from abc import ABC, abstractmethod
from asyncio import Future, ensure_future
from collections import OrderedDict
from pulsar.api import chain_future, ImproperlyConfigured
from pulsar.apps.http import HttpClient
from pulsar.apps.greenio import GreenPool
from pulsar.apps.data.channels import Connector
from pulsar.utils.importer import module_attribute
from .utils.serializers import serializers





class MessageFuture(Future):

    def __init__(self, message_id, backend, *, loop=None):
        super().__init__(loop=loop)
        self.message_id = message_id
        self.backend = backend

    def wait(self):     # pragma    nocover
        assert not self._loop.is_running(), 'cannot wait if loop is running'
        return self._loop.run_until_complete(_wait(self))


    def _repr_info(self):