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 :  /proc/self/root/usr/local/lib/python3.9/site-packages/kombu/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/local/lib/python3.9/site-packages/kombu/__pycache__/pools.cpython-39.pyc
a

��Sh��@sdZddlmZddlZddlmZddlmZddlm	Z	ddl
mZdd	lm
Z
dd
lmZdZdgZgZe�Zej�d
�Zdd�ZGdd�de�ZGdd�de�Zdd�ZGdd�de�Zeeed��ZGdd�de�Zeeed��Zdd�Z dd�Z!d$d d!�Z"d"d#�Z#dS)%zPublic resource pools.�)�annotationsN)�chain�)�Resource)�Producer)�EqualityDict)�register_after_fork)�lazy)�ProducerPool�	PoolGroup�register_group�connections�	producers�	get_limit�	set_limit�reset�
ZKOMBU_DISABLE_LIMIT_PROTECTIONcCs|��dS�N)�clear��group�r�5/usr/local/lib/python3.9/site-packages/kombu/pools.py�_after_fork_cleanup_groupsrcsdeZdZdZeZdZ�fdd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Z�fdd�Z
�ZS)r
z*Pool of :class:`kombu.Producer` instances.Tcs0||_|�dd�p|j|_t�j|i|��dS)Nr)r
�popr�super�__init__)�selfr
�args�kwargs��	__class__rrr szProducerPool.__init__cCs|jjdd�S)NT)�block)r
�acquire�rrrr�_acquire_connection%sz ProducerPool._acquire_connectioncCs6|��}z|�|�WSty0|���Yn0dSr)r%r�
BaseException�release)r�connrrr�create_producer(szProducerPool.create_producercCs
t|j�Sr)r	r)r$rrr�new0szProducerPool.newcCs*|jr&t|j�D]}|j�|���qdSr)�limit�rangeZ	_resource�
put_nowaitr*)r�_rrr�setup3szProducerPool.setupcCsdSrr�r�resourcerrr�close_resource8szProducerPool.close_resourcecCsPt|�r|�}|jdurL|��}z|�|�WntyJ|���Yn0|Sr)�callableZ_channelr%Zreviver&r')r�pr(rrr�prepare;s
zProducerPool.preparecs&|jr|j��d|_t��|�dSr)Z__connection__r'Zchannelrr0r rrr'Gs
zProducerPool.release)�__name__�
__module__�__qualname__�__doc__r�close_after_forkrr%r)r*r/r2r5r'�
__classcell__rrr rr
sr
c@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)rzCollection of resource pools.NTcCs(||_||_|jr$tdur$t|t�dSr)r+r:rr)rr+r:rrrrQszPoolGroup.__init__cCstd��dS)Nz!PoolGroups must define ``create``)�NotImplementedError)rr1r+rrr�createWszPoolGroup.createcCs,|j}|turt�}|�||�}||<|Sr)r+�use_global_limitrr=)rr1r+�krrr�__missing__Zs
zPoolGroup.__missing__)NT)r6r7r8r9rr=r@rrrrrNs
rcCst�|�|S)z*Register group (can be used as decorator).)�_groups�appendrrrrrbs
rc@seZdZdZdd�ZdS)�ConnectionszCollection of connection pools.cCs|j|d�S�N�r+)ZPool�r�
connectionr+rrrr=kszConnections.createN�r6r7r8r9r=rrrrrChsrCrEc@seZdZdZdd�ZdS)�	ProducerszCollection of producer pools.cCstt||d�SrD)r
r
rFrrrr=uszProducers.createNrHrrrrrIrsrIcCstdd�tD��S)Ncss"|]}|r|��ntg�VqdSr)�values�iter)�.0�grrr�	<genexpr>}�z_all_pools.<locals>.<genexpr>)rrArrrr�
_all_pools|srPcCstdS)z"Get current connection pool limit.r)�_limitrrrrr�srFcCs>|pd}tdpd}||kr:|td<t�D]}|�|�q*|S)zSet new connection pool limit.r)rQrP�resize)r+�forceZreset_after�
ignore_errorsZglimit�poolrrrr�s
rc	OsBt�D]$}z|��Wqty(Yq0qtD]}|��q0dS)z*Reset all pools by closing open resources.N)rPZforce_close_all�	ExceptionrAr)rrrUrrrrr�s
r)FFF)$r9�
__future__r�os�	itertoolsrrGrZ	messagingrZutils.collectionsrZutils.compatrZutils.functionalr	�__all__rQrA�objectr>�environ�getZdisable_limit_protectionrr
rrrCr
rIrrPrrrrrrr�<module>s24


Yohohohohohooho | Sanrei Aya