def __init__(self, identifier, domain, packeter, queues_storage=None):
        self.identifier = identifier[:MAX_IDENT_LENGTH]
        self.domain = domain
        self.packeter = packeter
        self.queues_manager = QueuesManager(queues_storage)
        self.log = logging.getLogger("snakemq.messaging")

        #: time to ping, in seconds (None = no keepalive)
        self.keepalive_interval = None
        self.keepalive_wait = 0.5  #: wait for pong, in seconds

        #{ callbacks
        self.on_error = Callback()  #: ``func(conn_id, exception)``
        self.on_message_recv = Callback()  #: ``func(conn_id, ident, message)``
        self.on_message_sent = Callback()  #: ``func(conn_id, ident, message_uuid)``
        #: ``func(ident, message_uuid)``
        #: Called when the message is dropped from the queue due to the TTL
        #: timeout.
        self.on_message_drop = Callback()
        self.on_connect = Callback()  #: ``func(conn_id, ident)``
        self.on_disconnect = Callback()  #: ``func(conn_id, ident)``
        #}

        self._ident_by_conn = {}
        self._conn_by_ident = {}
        self._keepalive = {}  #: conn_id:[last_recv, last_ping]
        self._message_by_packet = {}  #: packet id: message uuid

        packeter.link.on_loop_pass.add(self._on_link_loop_pass)
        packeter.on_connect.add(self._on_connect)
        packeter.on_disconnect.add(self._on_disconnect)
        packeter.on_packet_recv.add(self._on_packet_recv)
        packeter.on_packet_sent.add(self._on_packet_sent)
        self.queues_manager.on_item_drop.add(self._on_queue_item_drop)

        self._lock = threading.Lock()

    ###########################################################
Return an instance of this class formed from ``json_dict``.
dataset/ETHPy150Open dsiroky/snakemq/snakemq/messaging.py/Messaging.__init__--crossover with--dataset/ETHPy150Open sigmavirus24/github3.py/github3/models.py/GitHubCore.from_dict