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/billiard/__pycache__/queues.cpython-39.pyc
a

X>h�1�@s�ddlZddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZmZddlmZmZmZmZmZmZdd	lmZgd
�ZGdd�d�Ze�ZGd
d�de�ZGdd�d�ZGdd�de�ZdS)�N�)�
connection)�context)�	get_errno)�	monotonic)�Empty�Full)�debug�error�info�Finalize�register_after_fork�
is_exiting)�ForkingPickler)�Queue�SimpleQueue�
JoinableQueuec@s�eZdZdZd)dd�Zdd�Zdd�Zd	d
�Zd*d
d�Zd+dd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zed#d$��Zed%d&��Zed'd(��ZdS),rz4
    Queue type using a pipe, buffer and thread
    rcOs�z|d}Wnty&td��Yn0|dkr<ddlm}||_tjdd�\|_|_|�	�|_
t��|_
tjdkr|d|_n
|�	�|_|�|�|_d|_|��tjdkr�t|tj�dS)	N�ctxz-missing 1 required keyword-only argument: ctxrr)�
SEM_VALUE_MAXF��duplex�win32)�KeyError�	TypeErrorZsynchronizer�_maxsizer�Pipe�_reader�_writer�Lock�_rlock�os�getpid�_opid�sys�platform�_wlock�BoundedSemaphore�_sem�
_ignore_epipe�_after_forkr
r��self�maxsize�args�kwargsr�r/�9/usr/local/lib/python3.9/site-packages/billiard/queues.py�__init__#s$




zQueue.__init__cCs.t�|�|j|j|j|j|j|j|j|j	fS�N)
r�assert_spawningr(rrrrr%r'r"�r+r/r/r0�__getstate__<s
�zQueue.__getstate__c	Cs0|\|_|_|_|_|_|_|_|_|��dSr2)	r(rrrrr%r'r"r)�r+�stater/r/r0�__setstate__As�zQueue.__setstate__cCsvtd�t�t���|_t��|_d|_d|_	d|_
d|_d|_|j
j|_|jj|_|j
j|_|jj|_|jj|_dS)NzQueue._after_fork()F)r	�	threading�	Conditionr�	_notempty�collections�deque�_buffer�_thread�_jointhread�_joincancelled�_closed�_closer�send�_send_bytesr�recvZ_recv�
send_bytes�
recv_bytes�_recv_bytes�poll�_pollr4r/r/r0r)Fs




zQueue._after_forkTNcCsn|jr
J�|j�||�st�|j�8|jdur6|��|j�|�|j�	�Wd�n1s`0YdSr2)
rBr'�acquirerr;r?�
_start_threadr>�append�notify�r+�obj�block�timeoutr/r/r0�putUs

z	Queue.putcCs�|rF|durF|j�|��}Wd�n1s00Y|j��n�|rTt�|}|j�||�sft�zR|r�|t�}|dks�|�|�s�t�n|��s�t�|��}|j��W|j��n|j��0t�	|�S)Nr)
rrIr'�releaserrLrrKr�loads)r+rRrS�res�deadliner/r/r0�get`s&&

z	Queue.getcCs|j|jj��Sr2)rr'�_semlock�
_get_valuer4r/r/r0�qsizeyszQueue.qsizecCs
|��Sr2�rKr4r/r/r0�empty~szQueue.emptycCs|jj��Sr2)r'rZ�_is_zeror4r/r/r0�full�sz
Queue.fullcCs
|�d�S�NF)rYr4r/r/r0�
get_nowait�szQueue.get_nowaitcCs|�|d�Sra)rT�r+rQr/r/r0�
put_nowait�szQueue.put_nowaitcCsHd|_z$|j��W|j}|rDd|_|�n|j}|rBd|_|�0dS)NT)rBr�closerC)r+rer/r/r0re�s�zQueue.closecCs$td�|jsJ�|jr |��dS)NzQueue.join_thread())r	rBr@r4r/r/r0�join_thread�s
zQueue.join_threadcCs4td�d|_z|j��Wnty.Yn0dS)NzQueue.cancel_join_thread()T)r	rAr@�cancel�AttributeErrorr4r/r/r0�cancel_join_thread�szQueue.cancel_join_threadcCs�td�|j��tjtj|j|j|j|j	|j
j|jfdd�|_
d|j
_td�|j
��td�|jt��k}|js�|s�t|j
tjt�|j
�gdd�|_t|tj|j|jgd	d�|_dS)
NzQueue._start_thread()ZQueueFeederThread)�targetr-�nameTzdoing self._thread.start()z... done self._thread.start()���)Zexitpriority�
)r	r>�clearr9�Threadr�_feedr;rEr%rrer(r?�daemon�startr"r r!rAr�_finalize_join�weakref�refr@�_finalize_closerC)r+Zcreated_by_this_processr/r/r0rM�s2
��

�
�zQueue._start_threadcCs4td�|�}|dur(|��td�ntd�dS)Nzjoining queue threadz... queue thread joinedz... queue thread already dead)r	�join)Ztwr�threadr/r/r0rs�s
zQueue._finalize_joincCsBtd�|�"|�t�|��Wd�n1s40YdS)Nztelling queue thread to quit)r	rN�	_sentinelrO)�buffer�notemptyr/r/r0rv�s
zQueue._finalize_closecCs�td�|j}|j}|j}|j}	t}
tjdkr<|j}|j}nd}z�|�z|sT|�W|�n|�0zh|	�}
|
|
ur�td�|�WWdSt�	|
�}
|dur�||
�qh|�z||
�W|�qh|�0qhWqBt
y�YqB0qBWn�t�y�}z�|�rt|�t
jk�rWYd}~dSz<t��r6td|dd�n td|dd��sVddl}|��Wnt�ylYn0WYd}~n
d}~00dS)Nz$starting thread to feed data to piperz%feeder thread got sentinel -- exitingzerror in queue thread: %rT)�exc_infor)r	rLrU�wait�popleftryr#r$r�dumps�
IndexError�	Exceptionr�errno�EPIPErrr
�	traceback�	print_exc)rzr{rGZ	writelockreZignore_epipeZnacquireZnreleaseZnwaitZbpopleft�sentinelZwacquireZwreleaserQ�excr�r/r/r0rp�sX



�zQueue._feed)r)TN)TN)�__name__�
__module__�__qualname__�__doc__r1r5r8r)rTrYr\r^r`rbrdrerfrirM�staticmethodrsrvrpr/r/r/r0rs,



&
	
rc@sDeZdZdZddd�Zdd�Zdd�Zddd�Zd
d�Zdd�Z	d
S)rz�
    A queue type which also supports join() and task_done() methods

    Note that if you do not call task_done() for each finished task then
    eventually the counter's semaphore may overflow causing Bad Things
    to happen.
    rcOsRz|d}Wnty&td��Yn0tj|||d�|�d�|_|��|_dS)Nrz(missing 1 required keyword argument: ctx)rr)rrrr1�	Semaphore�_unfinished_tasksr:�_condr*r/r/r0r1"szJoinableQueue.__init__cCst�|�|j|jfSr2)rr5r�r�r4r/r/r0r5+szJoinableQueue.__getstate__cCs,t�||dd��|dd�\|_|_dS)N���)rr8r�r�r6r/r/r0r8.szJoinableQueue.__setstate__TNc	Cs�|jr
J�|j�||�st�|j�h|j�B|jdur>|��|j�	|�|j
��|j��Wd�n1sr0YWd�n1s�0YdSr2)
rBr'rLrr;r�r?rMr>rNr�rUrOrPr/r/r0rT2s


zJoinableQueue.putcCsT|j�:|j�d�std��|jj��r2|j��Wd�n1sF0YdS)NFz!task_done() called too many times)r�r�rL�
ValueErrorrZr_�
notify_allr4r/r/r0�	task_done?s
zJoinableQueue.task_donecCs@|j�&|jj��s|j��Wd�n1s20YdSr2)r�r�rZr_r}r4r/r/r0rwFszJoinableQueue.join)r)TN)
r�r�r�r�r1r5r8rTr�rwr/r/r/r0rs
	

rc@sZeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�ZdS)�_SimpleQueuez<
    Simplified Queue type -- really just a locked pipe
    FNcCs2tjd||d�\|_|_|jj|_d|_|_dS)NF)r�	rnonblock�	wnonblock)rrrrrJrKrr%)r+r�r�rr/r/r0r1Qs
�
z_SimpleQueue.__init__cCs
|��Sr2r]r4r/r/r0r^Xsz_SimpleQueue.emptycCst�|�|j|j|j|jfSr2)rr3rrrr%r4r/r/r0r5[s
z_SimpleQueue.__getstate__cCs|\|_|_|_|_dSr2)rrrr%r6r/r/r0r8_sz_SimpleQueue.__setstate__cCs
|j��Sr2)rrHr4r/r/r0�get_payloadbsz_SimpleQueue.get_payloadcCs|j�|�dSr2)rrG�r+�valuer/r/r0�send_payloadesz_SimpleQueue.send_payloadcCst�|���Sr2)rrVr�r4r/r/r0rYhsz_SimpleQueue.getcCs|�t�|��dSr2)r�rrrcr/r/r0rTlsz_SimpleQueue.putcCsT|jdur(z|j��Wd|_nd|_0|jdurPz|j��Wd|_nd|_0dSr2)rrerr4r/r/r0reps

z_SimpleQueue.close)FFN)
r�r�r�r�r1r^r5r8r�r�rYrTrer/r/r/r0r�Ls
r�c@s$eZdZdd�Zdd�Zdd�ZdS)rcOsbz|d}Wnty&td��Yn0tjdd�\|_|_|��|_tj	dkrX|��nd|_
dS)Nrz&missing required keyword argument: ctxFrr)rrrrrrrrr#r$r%)r+r-r.rr/r/r0r1�s
zSimpleQueue.__init__cCs4|j�|j��Wd�S1s&0YdSr2)rrrHr4r/r/r0r��szSimpleQueue.get_payloadcCsN|jdur|j�|�n2|j�|j�|�Wd�n1s@0YdSr2)r%rrGr�r/r/r0r��s
zSimpleQueue.send_payloadN)r�r�r�r1r�r�r/r/r/r0r~s	r) r#r r9r<rtr��rr�compatr�timer�queuerr�utilr	r
rrr
rZ	reductionr�__all__r�objectryrr�rr/r/r/r0�<module>
s& x32