o
    uyi                     @   s>   d Z ddlmZmZ ddlmZ ddlmZ G dd dZdS )z<Concurrency concepts that support efficient multi-threading.    )ExecutorThreadPoolExecutor)Optional)Configc                   @   sF   e Zd ZU dZee ed< edee fddZ	edefddZ
dS )ExecutorFactoryN	_instancereturnc                   C   s   t  dS )z,Return the max number of workers configured.zmax-workers)r   get_int r
   r
   ]/home/ubuntu/maya3_transcribe/venv/lib/python3.10/site-packages/pyiceberg/utils/concurrent.pymax_workers   s   zExecutorFactory.max_workersc                  C   s$   t jdu rt  } t| dt _t jS )z&Return the same executor in each call.Nr   )r   r   r   r   r   r
   r
   r   get_or_create!   s   
zExecutorFactory.get_or_create)__name__
__module____qualname__r   r   r   __annotations__staticmethodintr   r   r
   r
   r
   r   r      s   
 r   N)	__doc__concurrent.futuresr   r   typingr   pyiceberg.utils.configr   r   r
   r
   r
   r   <module>   s
   