ó
    Ð]jØ
  ã                  óÚ   • S r SSKJr  SSKrSSKrSSKrSSKJr  SSKJ	r	  SSK
J
r
  SSKJr  \R                  " 5         \R                  " S5      r        SS	 jr          SS
 jrg)ze
Some light wrappers around Python's multiprocessing, to deal with cleanly
starting child processes.
é    )ÚannotationsN)ÚCallable)ÚSpawnProcess)Úsocket)ÚConfigÚspawnc                ó®   •  [         R                  R                  5       nU UUUS.n[
        R                  [        US9$ ! [        [        4 a    Sn N3f = f)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©ÚconfigÚtargetÚsocketsÚstdin_fileno)r   Úkwargs)ÚsysÚstdinÚfilenoÚAttributeErrorÚOSErrorr   ÚProcessÚsubprocess_started)r   r   r   r   r   s        ÚP/home/mande/repo/quber/.venv/lib/python3.13/site-packages/uvicorn/_subprocess.pyÚget_subprocessr      s_   € ð"Ü—y‘y×'Ñ'Ó)ˆð ØØØ$ñ	€Fô �=‰=Ô 2¸6ˆ=ÐBÐBøô œGÐ$ó ØŠðús   ‚? ¿AÁAc                ó–   • Ub  [         R                  " U5      [        l        U R	                  5          U" US9  g! [
         a     gf = f)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   sI   € ð$ ÑÜ—I’I˜lÓ+ŒŒ	ð ×ÑÔðá�wÓøÜó ñ 	ðús   ´; »
AÁA)r   r   r   úCallable[..., None]r   úlist[socket]Úreturnr   )
r   r   r   r   r   r   r   z
int | Noner    ÚNone)Ú__doc__Ú
__future__r   Úmultiprocessingr   r   Úcollections.abcr   Úmultiprocessing.contextr   r   Úuvicorn.configr   Úallow_connection_picklingÚget_contextr   r   r   © ó    r   Ú<module>r,      s¢   ðñõ
 #ã Û 	Û 
Ý $Ý 0Ý å !à × )Ò )Ô +Ø×#Ò# GÓ,€ðCØðCàðCð ðCð ô	CðBØðàðð ðð ð	ð
 
õr+   