Ë
    êëj|
  ã                  óÞ  — U d Z ddlmZ ddlZddlZddlZddlmZmZm	Z	m
Z
 ddlmZmZ ej                  Zded<   d	Zded
<    ed«      Zer#ej&                  Zded<   ej&                  Zded<   n9 G d„ de«      Z G d„ dej&                  e¬«      Z G d„ dej&                  e¬«      Z G d„ dee   «      Z G d„ dee   «      Z	 	 d	 	 	 	 	 	 	 dd„Z	 	 d	 	 	 	 	 	 	 dd„Zddœdd„Zddœd d„Zy)!zø
Utilities to ease the differences between async and sync code.

These object offer a similar interface between sync and async versions; the
script async_to_sync.py will replace the async names with the sync names
when generating the sync version.
é    )ÚannotationsN)ÚTYPE_CHECKINGÚAnyÚCallableÚ	Coroutineé   )Ú	TypeAliasÚTypeVarr	   ÚWorkerúasyncio.Task[None]ÚAWorkerÚTÚ_GQueueÚ_AGQueuec                  ó   — e Zd Zd„ Zy)ÚFakeGenericMetac                ó   — | S )N© )ÚselfÚitems     úW/var/www/html/kelly/kelly-backend/venv/lib/python3.12/site-packages/psycopg/_acompat.pyÚ__getitem__zFakeGenericMeta.__getitem__!   s   € ØˆKó    N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r       s   „ ó	r   r   c                  ó   — e Zd Zy)r   N©r   r   r   r   r   r   r   r   $   ó   „ Ør   )Ú	metaclassc                  ó   — e Zd Zy)r   Nr   r   r   r   r   r   '   r   r   c                  ó&   ‡ — e Zd ZdZddˆ fd„Zˆ xZS )ÚQueuez>
    A Queue subclass with an interruptible get() method.
    c                ó.   •— |€d}t         ‰| �  ||¬«      S )Ng     õ@)ÚblockÚtimeout)ÚsuperÚget)r   r%   r&   Ú	__class__s      €r   r(   z	Queue.get0   s    ø€ àˆ?Ø(ˆGÜ‰w‰{ °ˆ{Ó8Ð8r   )TN)r%   Úboolr&   úfloat | NoneÚreturnr   )r   r   r   Ú__doc__r(   Ú__classcell__)r)   s   @r   r#   r#   +   s   ø„ ñ÷9ò 9r   r#   c                  ó   — e Zd Zy)ÚAQueueNr   r   r   r   r0   r0   7   s   „ Ør   r0   c                ó6   — t        j                   | |Ž |¬«      S )z,
    Equivalent to asyncio.create_task.
    )Úname)ÚasyncioÚcreate_task)ÚfÚargsr2   s      r   Úaspawnr7   ;   s   € ô ×Ñ™q $˜x¨dÔ3Ð3r   c                óX   — t        j                  | ||d¬«      }|j                  «        |S )z=
    Equivalent to creating and running a daemon thread.
    T)Útargetr6   r2   Údaemon)Ú	threadingÚThreadÚstart)r5   r6   r2   Úts       r   Úspawnr?   F   s(   € ô 	×Ñ ¨°4ÀÔE€AØ‡G�G„IØ€Hr   ©r&   c              ‡  óì   K  — t        j                  |Ž }	 | �3t        j                  t        j                  |«      | ¬«      ƒ d{  –—†  y|ƒ d{  –—†  	 y7 Œ7 Œ# t         j                  $ r Y yw xY w­w)ú7
    Equivalent to asyncio.gather or Thread.join()
    Nr@   )r3   ÚgatherÚwait_forÚshieldÚTimeoutError)r&   ÚtasksÚwaits      r   ÚagatherrI   S   st   è ø€ ô �>‰>˜5Ð!€DðØÐÜ×"Ñ"¤7§>¡>°$Ó#7ÀÔI×IÐIð 	ð	 �J‰Jð 	ð JøàùÜ×Ñò ÙðüsX   ‚A4–/A ÁAÁA Á
A4ÁA ÁAÁA ÁA4ÁA ÁA ÁA1Á.A4Á0A1Á1A4c                óV   — |D ]$  }|j                  «       sŒ|j                  | «       Œ& y)rB   N)Úis_aliveÚjoin)r&   rG   r>   s      r   rC   rC   c   s%   € ó ˆØ�z‰zŒ|ØØ	�‰ˆw�ñ r   )r   N)r5   z(Callable[..., Coroutine[Any, Any, None]]r6   útuple[Any, ...]r2   ú
str | Noner,   r   )r5   zCallable[..., Any]r6   rM   r2   rN   r,   úthreading.Thread)rG   zasyncio.Task[Any]r&   r+   r,   ÚNone)rG   rO   r&   r+   r,   rP   )r-   Ú
__future__r   Úqueuer3   r;   Útypingr   r   r   r   Ú_compatr	   r
   r<   r   Ú__annotations__r   r   r#   r   r   Útyper   r0   r7   r?   rI   rC   r   r   r   Ú<module>rW      s.  ðòõ #ã Û Û ß :Ó :ç 'à×$Ñ$€ˆ	Ó $Ø)€ˆÓ )ÙˆCƒL€ñ ØŸ™€GˆYÓ$Ø!Ÿ-™-€HˆiÔ'ô˜$ô ô�%—+‘+¨õ ô�7—=‘=¨Oõ ô	9ˆG�A‰Jô 	9ô	ˆX�a‰[ô 	ð Øð4Ø/ð4à
ð4ð ð4ð ó	4ð Øð
Øð
à
ð
ð ð
ð ó	
ð FJõ ð  >Bö r   