# 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 pulsar.api import Setting
from pulsar.utils.config import (
    validate_list, validate_bool, validate_pos_float
)
from pulsar.utils.importer import module_attribute
from ..utils.serializers import serializers



DEFAULT_MQ_BACKEND = 'redis://127.0.0.1:6379/7?namespace=pq'


def constant_or_function(value):
    try:
        value = int(value)
    except ValueError:
        return module_attribute(value)
    else:
        return Constant(value)


class Constant:

    def __init__(self, value):
        self.value = value

    def __call__(self, cfg):
        return self.value


class TaskSetting(Setting):

# 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/server/config.py
from pulsar.api import Setting
from pulsar.utils.config import (
    validate_list, validate_bool, validate_pos_float
)
from pulsar.utils.importer import module_attribute
from ..utils.serializers import serializers




DEFAULT_MQ_BACKEND = 'redis://127.0.0.1:6379/7?namespace=pq'


def constant_or_function(value):
    try:
        value = int(value)
    except ValueError:
        return module_attribute(value)
    else:
        return Constant(value)


class Constant:

    def __init__(self, value):
        self.value = value

    def __call__(self, cfg):
        return self.value


class TaskSetting(Setting):

    virtual = True