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/kombu/utils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

��Sho�@s�dZddlmZddlmZddlmZdZddd	d
�ZGdd�d�Z	Gd
d�d�Z
Gdd�de
�ZGdd�de�Zdd�Z
dS)zScheduling Utilities.�)�annotations)�count�)�symbol_by_name)�	FairCycle�priority_cycle�round_robin_cycle�sorted_cyclez%kombu.utils.scheduling:priority_cyclez(kombu.utils.scheduling:round_robin_cyclez#kombu.utils.scheduling:sorted_cycle)�priorityZround_robin�sortedc@s<eZdZdZefdd�Zdd�Zdd�Zdd	�Zd
d�Z	dS)
ra2Cycle between resources.

    Consume from a set of resources, where each resource gets
    an equal chance to be consumed from.

    Arguments:
    ---------
        fun (Callable): Callback to call.
        resources (Sequence[Any]): List of resources.
        predicate (type): Exception predicate.
    cCs||_||_||_d|_dS)Nr)�fun�	resources�	predicate�pos)�selfrr
r�r�@/usr/local/lib/python3.9/site-packages/kombu/utils/scheduling.py�__init__!szFairCycle.__init__cCsNz |j|j}|jd7_|WStyFd|_|jsB|���Yq0qdS)Nrr)r
r�
IndexErrorr)r�resourcerrr�_next'szFairCycle._nextc	Ks^td�D]P}|��}z|j||fi|��WS|jyV|t|j�dkrR�Yq0qdS)zGet from next resource.rrN)rrrr�lenr
)r�callback�kwargsZtriedrrrr�get2sz
FairCycle.getcCsdS)zClose cycle.Nr�rrrr�close=szFairCycle.closecCsdj|t|j�d�S)z``repr(cycle)``.z/<FairCycle: {self.pos}/{size} {self.resources}>)r�size)�formatrr
rrrr�__repr__@s
�zFairCycle.__repr__N)
�__name__�
__module__�__qualname__�__doc__�	Exceptionrrrrrrrrrrsrc@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)rz2Iterator that cycles between items in round-robin.NcCs|dur|ng|_dS)N��items�r�itrrrrIszround_robin_cycle.__init__cCs||jdd�<dS)zUpdate items from iterable.Nr%r'rrr�updateLszround_robin_cycle.updatecCs|jd|�S�zConsume n items.Nr%�r�nrrr�consumePszround_robin_cycle.consumecCs8|j}z|�|�|�|���Wnty2Yn0|S)z,Move most recently used item to end of list.)r&�append�pop�index�
ValueError)r�	last_usedr&rrr�rotateTszround_robin_cycle.rotate)N)r r!r"r#rr)r-r3rrrrrFs

rc@seZdZdZdd�ZdS)rz"Cycle that repeats items in order.cCsdS)zUnused in this implementation.Nr)rr2rrrr3aszpriority_cycle.rotateN)r r!r"r#r3rrrrr^src@seZdZdZdd�ZdS)r	zCycle in sorted order.cCst|jd|��Sr*)rr&r+rrrr-hszsorted_cycle.consumeN)r r!r"r#r-rrrrr	esr	cCs
t|t�S)zGet cycle class by name.)r�
CYCLE_ALIASES)�namerrr�
cycle_by_namemsr6N)r#�
__future__r�	itertoolsrZimportsr�__all__r4rrrr	r6rrrr�<module>s�2

Yohohohohohooho | Sanrei Aya