§
     @gc	  ã            
       ó  — d 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m	Z	m
Z
 ddlmZ  ej        ¦   «           ej        d¦  «        Zded	ed
         de	e         defd„Zded	ed
         de	e         de
e         ddf
d„ZdS )ze
Some light wrappers around Python's multiprocessing, to deal with cleanly
starting child processes.
é    N)ÚSpawnProcess)Úsocket)ÚCallableÚListÚOptional)ÚConfigÚspawnÚconfigÚtarget).NÚsocketsÚreturnc                 ó¶   — 	 t           j                             ¦   «         }n# t          $ 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ÚOSErrorr	   ÚProcessÚsubprocess_started)r
   r   r   r   r   s        úG/var/www/piapp/venv/lib/python3.11/site-packages/uvicorn/_subprocess.pyÚget_subprocessr      ss   € ð$Ý”y×'Ò'Ñ)Ô)ˆˆøÝð ð ð Øˆˆˆðøøøð ØØØ$ð	ð €Fõ �=Š=Õ 2¸6ˆ=ÑBÔBÐBs   ‚! ¡0¯0r   c                 ó†   — |�t          j        |¦  «        t          _        |                      ¦   «           ||¬¦  «         dS )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_loggingr   s       r   r   r   3   sJ   € ð$ ÐÝ”I˜lÑ+Ô+�Œ	ð ×ÒÑÔÐð €F�7ÐÑÔÐÐÐó    )Ú__doc__Úmultiprocessingr   r   Úmultiprocessing.contextr   r   Útypingr   r   r   Úuvicorn.configr   Úallow_connection_picklingÚget_contextr	   r   Úintr   © r   r   ú<module>r(      sI  ððð ð Ð Ð Ð Ø 	€	€	€	Ø 
€
€
€
Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø Ð Ð Ð Ð Ð Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +à !Ð !Ð !Ð !Ð !Ð !à )€Ô )Ñ +Ô +Ð +Ø#ˆÔ# GÑ,Ô,€ðCØðCà�YÔðCð �&Œ\ðCð ð	Cð Cð Cð CðBØðà�YÔðð �&Œ\ðð ˜3”-ð	ð
 
ðð ð ð ð ð r   