o
    i                     @   s:   d Z ddlZddlmZmZ ddlmZ G dd dZdS )z<Concurrency concepts that support efficient multi-threading.    N)ExecutorThreadPoolExecutor)Configc                   @   sV   e Zd ZU dZedB ed< dZedB ed< ededB fddZ	edefddZ
dS )	ExecutorFactoryN	_instance_instance_pidreturnc                   C   s   t  dS )z,Return the max number of workers configured.zmax-workers)r   get_int r
   r
   X/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/pyiceberg/utils/concurrent.pymax_workers   s   zExecutorFactory.max_workersc                  C   sB   t jt krt t _dt _t jdu rt  } t| dt _t jS )z&Return the same executor in each call.Nr   )r   r   osgetpidr   r   r   r   r
   r
   r   get_or_create"   s   

zExecutorFactory.get_or_create)__name__
__module____qualname__r   r   __annotations__r   intstaticmethodr   r   r
   r
   r
   r   r      s   
 r   )__doc__r   concurrent.futuresr   r   pyiceberg.utils.configr   r   r
   r
   r
   r   <module>   s
   