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/kombu/__pycache__/pools.cpython-39.pyc
a

X>h��@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