Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/sentry_sdk/__pycache__/_queue.cpython-311.pyc
]j d Z ddlZddlmZ ddlmZ ddlmZ erddlmZ g dZ G d d e
Z G d
de
Z G d d
e
ZdS )a
A fork of Python 3.6's stdlib queue with Lock swapped out for RLock to avoid a
deadlock while garbage collecting.
See
https://codewithoutrules.com/2017/08/16/concurrency-python/
https://bugs.python.org/issue14976
https://github.com/sqlalchemy/sqlalchemy/blob/4eb747b61f0c1b1c25bdee3856d7195d10a0c227/lib/sqlalchemy/queue.py#L1
We also vendor the code to evade eventlet's broken monkeypatching, see
https://github.com/getsentry/sentry-python/pull/484
N)deque)time)MYPY)Any)EmptyFullQueuec e Zd ZdZdS )r z4Exception raised by Queue.get(block=0)/get_nowait().N__name__
__module____qualname____doc__ H/opt/imunify360/venv/lib64/python3.11/site-packages/sentry_sdk/_queue.pyr r ::Dr r c e Zd ZdZdS )r z4Exception raised by Queue.put(block=0)/put_nowait().Nr r r r r r r r r c l e Zd ZdZddZd Zd Zd Zd Zd Z ddZ
ddZd
Zd Z
d Zd Zd Zd Zd
S )r zjCreate a queue object with a given maximum size.
If maxsize is <= 0, the queue size is infinite.
r c 0 || _ | | t j | _ t j | j | _ t j | j | _ t j | j | _ d| _ d S )Nr )
maxsize_init threadingRLockmutex Condition not_emptynot_fullall_tasks_doneunfinished_tasksselfr s r __init__zQueue.__init__+ s}
7 _&&
#,TZ88 "+DJ77
(1$*== !r c | j 5 | j dz
}|dk r.|dk rt d | j || _ ddd dS # 1 swxY w Y dS )a. Indicate that a formerly enqueued task is complete.
Used by Queue consumer threads. For each get() used to fetch a task,
a subsequent call to task_done() tells the queue that the processing
on the task is complete.
If a join() is currently blocking, it will resume when all items
have been processed (meaning that a task_done() call was received
for every item that had been put() into the queue).
Raises a ValueError if called more times than there were items
placed in the queue.
r z!task_done() called too many timesN)r r
ValueError
notify_all)r"