§
    !ß·iD  ã                   ód   — d dl Z d dlZ	 d dlZn# e$ r dZY nw xY wddlmZ  G d„ de¦  «        ZdS )é    Né   )ÚPubSubManagerc                   ó^   ‡ — e Zd ZdZdZ	 	 	 	 dˆ fd„	Zˆ fd„Zd	„ Zd
„ Zd„ Z	d„ Z
d„ Zd„ Zˆ xZS )ÚKombuManagera²	  Client manager that uses kombu for inter-process messaging.

    This class implements a client manager backend for event sharing across
    multiple processes, using RabbitMQ, Redis or any other messaging mechanism
    supported by `kombu <http://kombu.readthedocs.org/en/latest/>`_.

    To use a kombu backend, initialize the :class:`Server` instance as
    follows::

        url = 'amqp://user:password@hostname:port//'
        server = socketio.Server(client_manager=socketio.KombuManager(url))

    :param url: The connection URL for the backend messaging queue. Example
                connection URLs are ``'amqp://guest:guest@localhost:5672//'``
                and ``'redis://localhost:6379/'`` for RabbitMQ and Redis
                respectively. Consult the `kombu documentation
                <http://kombu.readthedocs.org/en/latest/userguide                /connections.html#urls>`_ for more on how to construct
                connection URLs.
    :param channel: The channel name on which the server sends and receives
                    notifications. Must be the same in all the servers.
    :param write_only: If set to ``True``, only initialize to emit events. The
                       default of ``False`` initializes the class for emitting
                       and receiving. A write-only instance can be used
                       independently of the server to emit to clients from an
                       external process.
    :param logger: a custom logger to log it. If not given, the server logger
                   is used.
    :param json: An alternative JSON module to use for encoding and decoding
                 packets. Custom json modules must have ``dumps`` and ``loads``
                 functions that are compatible with the standard library
                 versions. This setting is only used when ``write_only`` is set
                 to ``True``. Otherwise the JSON module configured in the
                 server is used.
    :param connection_options: additional keyword arguments to be passed to
                               ``kombu.Connection()``.
    :param exchange_options: additional keyword arguments to be passed to
                             ``kombu.Exchange()``.
    :param queue_options: additional keyword arguments to be passed to
                          ``kombu.Queue()``.
    :param producer_options: additional keyword arguments to be passed to
                             ``kombu.Producer()``.
    Úkombuú#amqp://guest:guest@localhost:5672//ÚsocketioFNc
                 ó  •— t           €t          d¦  «        ‚t          ¦   «                              ||||¬¦  «         || _        |pi | _        |pi | _        |pi | _        |	pi | _        |  	                    ¦   «         | _
        d S )NzLKombu package is not installed (Run "pip install kombu" in your virtualenv).)ÚchannelÚ
write_onlyÚloggerÚjson)r   ÚRuntimeErrorÚsuperÚ__init__ÚurlÚconnection_optionsÚexchange_optionsÚqueue_optionsÚproducer_optionsÚ_connectionÚpublisher_connection)Úselfr   r   r   r   r   r   r   r   r   Ú	__class__s             €ú[/home/mmwave/public_html/mmwave/venv/lib/python3.11/site-packages/socketio/kombu_manager.pyr   zKombuManager.__init__:   s¢   ø€ õ ˆ=Ýð  .ñ /ô /ð /õ 	‰Œ×Ò °ZÈØ"ð 	ñ 	$ô 	$ð 	$àˆŒØ"4Ð":¸ˆÔØ 0Ð 6°BˆÔØ*Ð0¨bˆÔØ 0Ð 6°BˆÔØ$(×$4Ò$4Ñ$6Ô$6ˆÔ!Ð!Ð!ó    c                 ó
  •— t          ¦   «                              ¦   «          d}| j        j        dk    rddlm}  |d¦  «        }nd| j        j        v rddlm}  |d¦  «        }|st          d| j        j        z   ¦  «        ‚d S )	NTÚeventletr   )Úis_monkey_patchedÚsocketÚgevent)Úis_module_patchedz<Kombu requires a monkey patched socket library to work with )	r   Ú
initializeÚserverÚ
async_modeÚeventlet.patcherr   Úgevent.monkeyr"   r   )r   Úmonkey_patchedr   r"   r   s       €r   r#   zKombuManager.initializeK   sº   ø€ Ý‰Œ×ÒÑÔÐàˆØŒ;Ô! ZÒ/Ð/Ø:Ð:Ð:Ð:Ð:Ð:Ø.Ð.¨xÑ8Ô8ˆNˆNØ˜œÔ/Ð/Ð/Ø7Ð7Ð7Ð7Ð7Ð7Ø.Ð.¨xÑ8Ô8ˆNØð 	2ÝðØœ+Ô0ñ1ñ2ô 2ð 2ð	2ð 	2r   c                 ó:   — t          j        | j        fi | j        ¤ŽS )N)r   Ú
Connectionr   r   )r   s    r   r   zKombuManager._connectionZ   s    € ÝÔ ¤ÐDÐD¨DÔ,CÐDÐDÐDr   c                 ón   — dddœ}|                      | j        ¦  «         t          j        | j        fi |¤ŽS )NÚfanoutF)ÚtypeÚdurable)Úupdater   r   ÚExchanger   )r   Úoptionss     r   Ú	_exchangezKombuManager._exchange]   s>   € Ø#°Ð6Ð6ˆØ�Š�tÔ,Ñ-Ô-Ð-ÝŒ~˜dœlÐ6Ð6¨gÐ6Ð6Ð6r   c                 óÔ   — dt          t          j        ¦   «         ¦  «        z   }dddidœ}|                     | j        ¦  «         t          j        ||                      ¦   «         fi |¤ŽS )Nzpython-socketio.Fz	x-expiresià“ )r.   Úqueue_arguments)ÚstrÚuuidÚuuid4r/   r   r   ÚQueuer2   )r   Ú
queue_namer1   s      r   Ú_queuezKombuManager._queueb   se   € Ø'­#­d¬j©l¬lÑ*;Ô*;Ñ;ˆ
Ø#¸ÀfÐ8MÐNÐNˆØ�Š�tÔ)Ñ*Ô*Ð*ÝŒ{˜: t§~¢~Ñ'7Ô'7ÐCÐC¸7ÐCÐCÐCr   c                 ó„   —  |j         dd|                      ¦   «         i| j        ¤Ž}|                     ||j        ¦  «        S )NÚexchange© )ÚProducerr2   r   ÚensureÚpublish)r   Ú
connectionÚproducers      r   Ú_producer_publishzKombuManager._producer_publishh   sU   € Ø&�:Ô&ð @ð @°·²Ñ0@Ô0@ð @Ø)-Ô)>ð@ð @ˆà× Ò  ¨8Ô+;Ñ<Ô<Ð<r   c                 óx  — d}	 	 |                       | j        ¦  «        } || j                             |¦  «        ¦  «         d S # t          t
          j        j        f$ rY |r*|                      ¦   «          	                    d¦  «         d}n*|                      ¦   «          	                    d¦  «         Y d S Y nw xY wŒ¸)NTz&Cannot publish to rabbitmq... retryingFz'Cannot publish to rabbitmq... giving up)
rC   r   r   ÚdumpsÚOSErrorr   Ú
exceptionsÚ
KombuErrorÚ_get_loggerÚerror)r   ÚdataÚretryÚproducer_publishs       r   Ú_publishzKombuManager._publishm   sì   € Øˆð	ðØ#'×#9Ò#9ØÔ-ñ$/ô $/Ð à Ð  ¤§¢°Ñ!6Ô!6Ñ7Ô7Ð7Ø�øÝ�UÔ-Ô8Ð9ð ð ð Øð Ø×$Ò$Ñ&Ô&×,Ò,ð .8ñ 9ô 9ð 9à!�E�Eà×$Ò$Ñ&Ô&×,Ò,ØAñCô Cð Cà�E�Eð	 �Eð	øøøð	s   …=A ÁA.B8Â7B8c              #   óJ  K  — d}	 	 |                       ¦   «         }|                      ¦   «         5 }|                     |¦  «        5 }	 |                     d¬¦  «        }|                     ¦   «          |j        V — d}Œ6# 1 swxY w Y   	 d d d ¦  «         n# 1 swxY w Y   n‚# t          t          j        j	        f$ rd |  
                    ¦   «                              d                     |¦  «        ¦  «         t          j        |¦  «         t          |dz  d¦  «        }Y nw xY w�Œ)Nr   T)Úblockz3Cannot receive from rabbitmq... retrying in {} secsé   é<   )r:   r   ÚSimpleQueueÚgetÚackÚpayloadrF   r   rG   rH   rI   rJ   ÚformatÚtimeÚsleepÚmin)r   Úretry_sleepÚreader_queuerA   ÚqueueÚmessages         r   Ú_listenzKombuManager._listen   s˜  è è € Øˆð	7ð7Ø#Ÿ{š{™}œ}�Ø×%Ò%Ñ'Ô'ð ,¨:Ø#×/Ò/°Ñ=Ô=ð ,Àð,Ø&+§i¢i°d iÑ&;Ô&;˜GØ#ŸKšK™MœM˜MØ")¤/Ð1Ð1Ð1Ø*+˜Kð	,ð,ð ,ð ,ð ,øøøð ,ð ,ð ,ð ,ð ,ð,ð ,ð ,ñ ,ô ,ð ,ð ,ð ,ð ,ð ,ð ,øøøð ,ð ,ð ,ð ,øøõ �UÔ-Ô8Ð9ð 7ð 7ð 7Ø× Ò Ñ"Ô"×(Ò(ð*ß*0ª&°Ñ*=Ô*=ñ?ô ?ð ?õ ”
˜;Ñ'Ô'Ð'Ý! +°¡/°2Ñ6Ô6���ð7øøøñ	7sS   ‡(B! ¯BÁ8A=Á=B	ÂBÂB	ÂBÂ	B! ÂBÂB! ÂBÂB! Â!A<D ÄD )	r   r	   FNNNNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Únamer   r#   r   r2   r:   rC   rN   r_   Ú__classcell__)r   s   @r   r   r      sÔ   ø€ € € € € ð*ð *ðV €Dà@ØIMØ;?Ø6:ð7ð 7ð 7ð 7ð 7ð 7ð"2ð 2ð 2ð 2ð 2ðEð Eð Eð7ð 7ð 7ð
Dð Dð Dð=ð =ð =ð
ð ð ð$7ð 7ð 7ð 7ð 7ð 7ð 7r   r   )rX   r6   r   ÚImportErrorÚpubsub_managerr   r   r=   r   r   ú<module>rh      s�   ðØ €€€Ø €€€ðØ€L€L€L€LøØð ð ð Ø€E€E€Eðøøøð *Ð )Ð )Ð )Ð )Ð )ðD7ð D7ð D7ð D7ð D7�=ñ D7ô D7ð D7ð D7ð D7s   Š �˜