§
    #ˆtjØ
  ã                  ó¬   — d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddl
m
Z
 ddlmZ  ej        ¦   «           ej        d¦  «        Zdd„Zdd„ZdS )ze
Some light wrappers around Python's multiprocessing, to deal with cleanly
starting child processes.
é    )ÚannotationsN)ÚCallable)ÚSpawnProcess)Úsocket)ÚConfigÚspawnÚconfigr   ÚtargetúCallable[..., None]Úsocketsúlist[socket]Úreturnr   c                óÄ   — 	 t           j                             ¦   «         }n# t          t          f$ r d}Y nw xY w| |||dœ}t
                               t          |¬¦  «        S )aÔ  
    Called in the parent process, to instantiate a new child process instance.
    The child is not yet started at this point.

    * config - The Uvicorn configuration instance.
    * target - A callable that accepts a list of sockets. In practice this will
               be the `Server.run()` method.
    * sockets - A list of sockets to pass to the server. Sockets are bound once
                by the parent process, and then passed to the child processes.
    N©r	   r
   r   Ústdin_fileno)r
   Úkwargs)ÚsysÚstdinÚfilenoÚAttributeErrorÚOSErrorr   ÚProcessÚsubprocess_started)r	   r
   r   r   r   s        úQ/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/uvicorn/_subprocess.pyÚget_subprocessr      sx   € ð"Ý”y×'Ò'Ñ)Ô)ˆˆøå�GÐ$ð ð ð Øˆˆˆðøøøð ØØØ$ð	ð €Fõ �=Š=Õ 2¸6ˆ=ÑBÔBÐBs   ‚! ¡7¶7r   ú
int | NoneÚNonec                óª   — |�t          j        |¦  «        t          _        |                      ¦   «          	  ||¬¦  «         dS # t
          $ r Y dS w xY w)aú  
    Called when the child process starts.

    * config - The Uvicorn configuration instance.
    * target - A callable that accepts a list of sockets. In practice this will
               be the `Server.run()` method.
    * sockets - A list of sockets to pass to the server. Sockets are bound once
                by the parent process, and then passed to the child processes.
    * stdin_fileno - The file number of sys.stdin, so that it can be reattached
                     to the child process.
    N)r   )ÚosÚfdopenr   r   Úconfigure_loggingÚKeyboardInterruptr   s       r   r   r   6   sq   € ð$ ÐÝ”I˜lÑ+Ô+�Œ	ð ×ÒÑÔÐðàˆ�wÐÑÔÐÐÐøÝð ð ð ð 	ˆˆðøøøs   ¶A Á
AÁA)r	   r   r
   r   r   r   r   r   )
r	   r   r
   r   r   r   r   r   r   r   )Ú__doc__Ú
__future__r   Úmultiprocessingr   r   Úcollections.abcr   Úmultiprocessing.contextr   r   Úuvicorn.configr   Úallow_connection_picklingÚget_contextr   r   r   © ó    r   ú<module>r-      sã   ððð ð
 #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø 	€	€	€	Ø 
€
€
€
Ø $Ð $Ð $Ð $Ð $Ð $Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø Ð Ð Ð Ð Ð à !Ð !Ð !Ð !Ð !Ð !à )€Ô )Ñ +Ô +Ð +Ø#ˆÔ# GÑ,Ô,€ðCð Cð Cð CðBð ð ð ð ð r,   