from wsmode import messages as m


class MessageCallbackHandler:
    def __init__(
        self,
    ):
        self.handlers = {}

    def dispatch(self, topic_message: m.TopicMessage):
        topic_message_type = topic_message.__class__
        handler_func = self.handlers.get(topic_message_type)
        return handler_func(topic_message)

    def register_event(self, msg_type: m.TopicMessage):
        def decorator(fn):
            self.handlers[msg_type] = fn
            return fn

        return decorator

f0cb3b63a82c17588622c2ff834f1a4796e205b6
<mask token>


class MessageCallbackHandler:
    <mask token>

    def dispatch(self, topic_message: m.TopicMessage):
        topic_message_type = topic_message.__class__
        handler_func = self.handlers.get(topic_message_type)
        return handler_func(topic_message)
    <mask token>

<mask token>


class MessageCallbackHandler:
    <mask token>

    def dispatch(self, topic_message: m.TopicMessage):
        topic_message_type = topic_message.__class__
        handler_func = self.handlers.get(topic_message_type)
        return handler_func(topic_message)

    def register_event(self, msg_type: m.TopicMessage):

        def decorator(fn):
            self.handlers[msg_type] = fn
            return fn
        return decorator

<mask token>


class MessageCallbackHandler:

    def __init__(self):
        self.handlers = {}

    def dispatch(self, topic_message: m.TopicMessage):
        topic_message_type = topic_message.__class__
        handler_func = self.handlers.get(topic_message_type)
        return handler_func(topic_message)

    def register_event(self, msg_type: m.TopicMessage):

        def decorator(fn):
            self.handlers[msg_type] = fn
            return fn
        return decorator

from wsmode import messages as m


class MessageCallbackHandler:

    def __init__(self):
        self.handlers = {}

    def dispatch(self, topic_message: m.TopicMessage):
        topic_message_type = topic_message.__class__
        handler_func = self.handlers.get(topic_message_type)
        return handler_func(topic_message)

    def register_event(self, msg_type: m.TopicMessage):

        def decorator(fn):
            self.handlers[msg_type] = fn
            return fn
        return decorator

from wsmode import messages as m


class MessageCallbackHandler:
    def __init__(
        self,
    ):
        self.handlers = {}

    def dispatch(self, topic_message: m.TopicMessage):
        topic_message_type = topic_message.__class__
        handler_func = self.handlers.get(topic_message_type)
        return handler_func(topic_message)

    def register_event(self, msg_type: m.TopicMessage):
        def decorator(fn):
            self.handlers[msg_type] = fn
            return fn

        return decorator
