HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/local/lib/python3.9/site-packages/celery/events/__pycache__/receiver.cpython-39.pyc
a

X>h��@s�dZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZd
dlmZdZd
Zedd�ZGdd�de	�ZdS)zEvent receiver implementation.�N)�
itemgetter)�Queue)�
maybe_channel)�
ConsumerMixin)�uuid)�app_or_default)�adjust_timestamp�)�get_exchange)�
EventReceiver����	utcoffset�	timestampc@s�eZdZdZdZddd�Zdd�Zdd	�Zddd�Zdd
d�Z	ddd�Z
ddd�Zd
eje
eefdd�Zeefdd�Zedd��ZdS)ra?Capture events.

    Arguments:
        connection (kombu.Connection): Connection to the broker.
        handlers (Mapping[Callable]): Event handlers.
            This is  a map of event type names and their handlers.
            The special handler `"*"` captures all events that don't have a
            handler.
    N�#c

	Cs�t|p
|j�|_t|�|_|dur&in||_||_|p:t�|_|pJ|jjj	|_
t|jp^|j�
�|jjjd�|_|dur�|jjj}|	dur�|jjj}	td�|j
|jg�|j|jdd||	d�|_|jj|_|jj|_|jj|_|dur�|jjjdh}||_dS)N)�name�.TF)�exchange�routing_keyZauto_deleteZdurableZmessage_ttl�expires�json)r�appr�channel�handlersrr�node_id�confZevent_queue_prefix�queue_prefixr
�
connectionZconnection_for_writeZevent_exchangerZevent_queue_ttlZevent_queue_expiresr�join�queue�clock�adjust�adjust_clockZforward�
forward_clockZevent_serializer�accept)
�selfrrrrrrr#Z	queue_ttlZ
queue_expires�r%�@/usr/local/lib/python3.9/site-packages/celery/events/receiver.py�__init__#s8
�

�


zEventReceiver.__init__cCs(|j�|�p|j�d�}|o"||�dS)z3Process event by dispatching to configured handler.�*N)r�get)r$�type�event�handlerr%r%r&�processBszEventReceiver.processcCs||jg|jgd|jd�gS)NT)�queues�	callbacksZno_ackr#)r�_receiver#)r$ZConsumerrr%r%r&�
get_consumersGs�zEventReceiver.get_consumersTcKs|r|j|d�dS)N)r)�wakeup_workers)r$rrZ	consumers�wakeup�kwargsr%r%r&�on_consume_readyLszEventReceiver.on_consume_readycCs|j|||d�S)N��limit�timeoutr3�Zconsume)r$r7r8r3r%r%r&�itercaptureQszEventReceiver.itercapturecCs|j|||d�D]}qdS)z�Open up a consumer capturing events.

        This has to run in the main process, and it will never stop
        unless :attr:`EventDispatcher.should_stop` is set to True, or
        forced via :exc:`KeyboardInterrupt` or :exc:`SystemExit`.
        r6Nr9)r$r7r8r3�_r%r%r&�captureTszEventReceiver.capturecCs|jjjd|j|d�dS)NZ	heartbeat)rr)r�control�	broadcastr)r$rr%r%r&r2^s
�zEventReceiver.wakeup_workerscCs�|d}|dkr4|jjpd|}|d<|�|�n6z|d}	Wnty^|��|d<Yn0|�|	�|r�z||�\}
}Wnty�Yn0|||
�|d<|�|d<||fS)Nr*z	task-sentr	rrZlocal_received)r�valuer!�KeyErrorr")r$�bodyZlocalize�nowZtzfieldsr�CLIENT_CLOCK_SKEWr*Z_cr�offsetrr%r%r&�event_from_messagecs"

z EventReceiver.event_from_messagecsB|||�r.|j|j����fdd�|D�n|j|�|��dS)Ncsg|]}��|���qSr%r%)�.0r+�Zfrom_messager-r%r&�
<listcomp>��z*EventReceiver._receive.<locals>.<listcomp>)r-rE)r$rA�message�list�
isinstancer%rGr&r0~s
zEventReceiver._receivecCs|jr|jjjSdS)N)rr�client)r$r%r%r&r�szEventReceiver.connection)NrNNNNNN)T)NNT)NNT)N)�__name__�
__module__�__qualname__�__doc__rr'r-r1r5r:r<r2�time�	_TZGETTERrrCrErKrLr0�propertyrr%r%r%r&rs*
�
�




�
r)rQrR�operatorrZkomburZkombu.connectionrZkombu.mixinsrZceleryrZ
celery.apprZcelery.utils.timerr+r
�__all__rCrSrr%r%r%r&�<module>s