HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/celery/__pycache__/_state.cpython-310.pyc
o

-we��@shdZddlZddlZddlZddlZddlmZddlmZdZ	da
dae��Z
e�Zdadd�Zd	d
�Zdd�Zd
d�ZGdd�dej�Ze�Ze�ZejZejZdd�Zdd�Zdd�Zej �!d�ridd�Z"n
ej �!d�rtdd�Z"neZ"dd�Z#dd�Z$ee"�Z%ee#�Z&d d!�Z'd"d#�Z(d$d%�Z)d/d&d'�Z*d/d(d)�Z+d*d+�Z,d,d-�Z-ej �!d.�r�e,�dSe-�dS)0z�Internal state.

This is an internal module containing thread state
like the ``current_app``, and ``current_task``.

This module shouldn't be used directly.
�N)�Proxy)�
LocalStack)�set_default_app�get_current_app�get_current_task�get_current_worker_task�current_app�current_task�connect_on_app_finalizeFcCst�|�|S)z8Connect callback to be called when any app is finalized.)�_on_app_finalizers�add)�callback�r�F/home/arjun/projects/env/lib/python3.10/site-packages/celery/_state.pyr
+s
r
cCstt�}|D]}||�qdS�N)�setr)�app�	callbacksr
rrr�_announce_app_finalized1s
�rcCs|adSr��_task_join_will_block)�blocksrrr�_set_task_join_will_block7�rcC�tSrrrrrr�task_join_will_block<�rc@seZdZdZdS)�_TLSN)�__name__�
__module__�__qualname__rrrrrr@srcCs|adS)zSet default app.N)�default_app�rrrrrV�rcCs>tdurddlm}t|dgdtj�d�pdd��tjptS)Nr��Celery�defaultF�
CELERY_LOADER)�fixups�set_as_current�loader)	r!�celery.app.baser%r�os�environ�get�_tlsrr$rrr�_get_current_app\s�
r0cCs
|t_dSr)r/rr"rrr�_set_current_appgs
r1�C_STRICT_APPcCstd��)zReturn the current app.zUSES CURRENT APP)�RuntimeErrorrrrrrlrr�
C_WARN_APPcCs*ddl}tdtjd�|jtjd�t�S)Nrz-- USES CURRENT_APP)�file)�	traceback�print�sys�stderr�print_stackr0)r6rrrrpscCstjS)zCurrently executing task.)�_task_stack�toprrrrrysrcCs$ttj�D]
}|jjs|SqdS)z�Currently executing task, that was applied by the worker.

    This is used to differentiate between the actual task
    executed by the worker and any task that was called within
    a task (using ``task.__call__`` or ``task.apply``)
    N)�reversedr;�stack�request�called_directly)�taskrrrr~s
��rcC�t�|�dSr)�_appsrr"rrr�
_register_app��rDcCrBr)rC�discardr"rrr�_deregister_app�rErGcCrr)rCrrrr�_get_active_apps�rrHcCs|durt�S|Sr)rr"rrr�_app_or_default�srIcCs�ddlm}zddlm}Wntyd}Ynw|durCttdd�r.td�|�tjS|r6|�j	dkr:t
d��td�|�tS|S)	Nr)r:)�current_processrz-- RETURNING TO CURRENT APP --�MainProcesszDEFAULT APPz-- RETURNING TO DEFAULT APP --)r6r:�billiard.processrJ�ImportError�getattrr/r7r�_name�	Exceptionr!)rr:rJrrr�_app_or_default_trace�s"�rQcC�tadS)z Enable tracing of app instances.N)rQ�app_or_defaultrrrr�enable_trace�r#rTcCrR)z!Disable tracing of app instances.N)rIrSrrrr�
disable_trace�r#rU�CELERY_TRACE_APPr).�__doc__r,r8�	threading�weakref�celery.localr�celery.utils.threadsr�__all__r!rS�WeakSetrCrrrr
rrr�localrr/r;�push�push_current_task�pop�pop_current_taskrr0r1r-r.rrrrr	rDrGrHrIrQrTrUrrrr�<module>sX