+
     hC  c                  s    ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^RIHt ^RIH	t	H
t
 ^RIHtHt ^RIHtHtHtHt ^RIHtHtHt ^RIHt ^R	IHtHt  ! R
 R4      t ! R R]4      t ! R R4      tR# )    )annotationsN)AutoBackend)SOCKET_OPTIONAsyncNetworkBackend)ConnectionNotAvailableUnsupportedProtocol)OriginProxyRequestResponse)
AsyncEventAsyncShieldCancellationAsyncThreadLock)AsyncHTTPConnection)AsyncConnectionInterfaceAsyncRequestInterfacec                  sV    ] tR t^tR R ltR R ltR R ltRR R	 lltR
 R ltRt	R# )AsyncPoolRequestc                    V ^8  d   QhRRRR/# )   requestr	   returnNone Zformat   "D/usr/lib/python3.14/site-packages/httpcore/_async/connection_pool.py__annotate__AsyncPoolRequest.__annotate__   s     1 1 1D 1    c                	s>    Wn         R V n        \        4       V n        R # N)r   
connectionr   _connection_acquired)selfr      &&r   __init__ZAsyncPoolRequest.__init__   s    ;?$.L!r   c               r   )r   r   zAsyncConnectionInterface | Noner   r   r   r   r   r   r   r      s     ( (/N (SW (r   c                	sF    Wn         V P                  P                  4        R # r   )r   r    Zset)r!   r   r"   r   assign_to_connectionZ%AsyncPoolRequest.assign_to_connection   s    $!!%%'r   c                   V ^8  d   QhRR/# r   r   r   r   r   r   r   r   r      s     1 1$ 1r   c                	s2    R V n         \        4       V n        R # r   )r   r   r    r!      &r   clear_connectionZ!AsyncPoolRequest.clear_connection   s    $.L!r   Nc               r   )r   timeoutfloat | Noner   r   r   r   r   r   r   r      s      #	!r   c                	s   "   V P                   f%   V P                  P                  VR7      G R j  xL
  V P                   #  L5i)Nr*   )r   r    Zwait)r!   r*   r"   r   wait_for_connectionZ$AsyncPoolRequest.wait_for_connection   s>      ??"++000AAA Bs   .AAAc               r%   )r   r   boolr   r   r   r   r   r   '   s     ' '4 'r   c                	s    V P                   R J # r   )r   r'   r(   r   	is_queuedZAsyncPoolRequest.is_queued'   s    $&&r   )r    r   r   r   )
__name__
__module____qualname____firstlineno__r#   r$   r)   r-   r/   __static_attributes__r   r   r   r   r      s     1
(1' 'r   r   c                  s    ] tR t^+tRtRR R lltR R lt]R R l4       tR	 R
 lt	R R lt
R R ltR R ltR R ltRR R lltR R ltRtR# )AsyncConnectionPoolz-
A connection pool for making HTTP requests.
Nc               sL    V ^8  d   QhRRRRRRRRRR	R
RRRRRRRRRRRRRRR/# )r   ssl_contextzssl.SSLContext | NoneproxyzProxy | Nonemax_connectionsz
int | Nonemax_keepalive_connectionskeepalive_expiryr+   http1r.   http2retriesZintlocal_addressz
str | Noneudsnetwork_backendzAsyncNetworkBackend | Nonesocket_optionsz%typing.Iterable[SOCKET_OPTION] | Noner   r   r   r   r   r   r    AsyncConnectionPool.__annotate__0   s     N7 N7*N7 N7 $	N7
 $.N7 'N7 N7 N7 N7 "N7 N7 4N7 >N7 
N7r   c                s   Wn         W n        Vf   \        P                  MTV n        Vf   \        P                  MTV n        \        V P                  V P
                  4      V n        WPn        W`n        Wpn	        Wn
        Wn        Wn        Vf   \        4       MTV n        Wn        . V n        . V n        \%        4       V n        R# )aC  
A connection pool for making HTTP requests.

Parameters:
    ssl_context: An SSL context to use for verifying connections.
        If not specified, the default `httpcore.default_ssl_context()`
        will be used.
    max_connections: The maximum number of concurrent HTTP connections that
        the pool should allow. Any attempt to send a request on a pool that
        would exceed this amount will block until a connection is available.
    max_keepalive_connections: The maximum number of idle HTTP connections
        that will be maintained in the pool.
    keepalive_expiry: The duration in seconds that an idle HTTP connection
        may be maintained for before being expired from the pool.
    http1: A boolean indicating if HTTP/1.1 requests should be supported
        by the connection pool. Defaults to True.
    http2: A boolean indicating if HTTP/2 requests should be supported by
        the connection pool. Defaults to False.
    retries: The maximum number of retries when trying to establish a
        connection.
    local_address: Local address to connect from. Can also be used to connect
        using a particular address family. Using `local_address="0.0.0.0"`
        will connect using an `AF_INET` address (IPv4), while using
        `local_address="::"` will connect using an `AF_INET6` address (IPv6).
    uds: Path to a Unix Domain Socket to use instead of TCP sockets.
    network_backend: A backend instance to use for handling network I/O.
    socket_options: Socket options that have to be included
     in the TCP socket when the connection was established.
N)_ssl_context_proxysysZmaxsize_max_connections_max_keepalive_connectionsZmin_keepalive_expiry_http1_http2_retries_local_address_udsr   _network_backend_socket_options_connections	_requestsr   _optional_thread_lock)r!   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   s   &&&&&&&&&&&&&r   r#   ZAsyncConnectionPool.__init__0   s    X (*2CKK 	
 )0 KK* 	'
 +.!!4#B#B+
' "2+	 -4KM/ 	  . =?13
 &5%6"r   c               r   )r   originr   r   r   r   r   r   r   r   rB      s     3
 3
 3
3K 3
r   c                	sX   V P                   Ee   V P                   P                  P                  R	9   d{   ^RIHp V! V P                   P                  P
                  V P                   P                  VV P                  V P                  V P                  V P                  V P                  R7      # VP                  R8X  do   ^RIHp V! V P                   P                  P
                  V P                   P                  V P                   P                  VV P                  V P                  R7      # ^RIHp V! V P                   P                  P
                  V P                   P                  V P                   P                  VV P                  V P                  V P                  V P                  V P                  R7	      # \#        VV P                  V P                  V P                  V P                  V P$                  V P&                  V P(                  V P                  V P*                  R7
      # )
N)AsyncSocks5Connection)proxy_originZ
proxy_authremote_originr6   r:   r;   r<   r@   s   http)AsyncForwardHTTPConnection)rU   proxy_headersproxy_ssl_contextrV   r:   r@   )AsyncTunnelHTTPConnection)	rU   rX   rY   rV   r6   r:   r;   r<   r@   )
rS   r6   r:   r;   r<   r=   r>   r?   r@   rA   )s   socks5s   socks5h)rD   urlschemeZsocks_proxyrT   rS   ZauthrC   rH   rI   rJ   rN   Z
http_proxyrW   headersr6   rZ   r   rK   rL   rM   rO   )r!   rS   rT   rW   rZ   s   &&   r   create_connectionZ%AsyncConnectionPool.create_connection   s   ;;"{{%%)@@>,!%!7!7#{{//"( $ 1 1%)%;%;++++$($9$9	 	 ')B1!%!7!7"&++"5"5&*kk&=&="(%)%;%;$($9$9  >,![[__33"kk11"&++"9"9$ --!%!7!7kkkk $ 5 5
 
 #))!33++++MM--		 11//
 	
r   c               r%   r   r   list[AsyncConnectionInterface]r   r   r   r   r   rB      s     ' '; 'r   c                s,    \        V P                  4      # )a{  
Return a list of the connections currently in the pool.

For example:

```python
>>> pool.connections
[
    <AsyncHTTPConnection ['https://example.com:443', HTTP/1.1, ACTIVE, Request Count: 6]>,
    <AsyncHTTPConnection ['https://example.com:443', HTTP/1.1, IDLE, Request Count: 9]> ,
    <AsyncHTTPConnection ['http://example.com:80', HTTP/1.1, IDLE, Request Count: 1]>,
]
```
)listrP   r'   r(   r   connectionsZAsyncConnectionPool.connections   s      D%%&&r   c               r   )r   r   r	   r   r
   r   r   r   r   r   rB      s     E
 E
' E
h E
r   c           
     s  "   VP                   P                  P                  4       pVR8X  d   \        R4      hVR9  d   \        RV R24      hVP                  P                  R/ 4      pVP                  RR4      pV P                  ;_uu_ 4        \        V4      pV P                  P                  V4       RRR4         V P                  ;_uu_ 4        V P                  4       pRRR4       V P                  X4      G Rj  xL
  XP                  VR7      G Rj  xL
 p VP                  VP                  4      G Rj  xL
 p \'        TP(                  TP*                  \-        TP.                  YPR	7      TP                  R
7      #   + '       g   i     L; i  + '       g   i     L; i L L Lq  \         d    TP!                  4         EK  i ; i  \"         d   p	T P                  ;_uu_ 4        T P                  P%                  X4       T P                  4       pRRR4       M  + '       g   i     M; iT P                  X4      G Rj  xL 
  T	RhRp	?	ii ; i5i)z
Send an HTTP request, and return an HTTP response.

This is the core implementation that is called into by `.request()` or `.stream()`.
Z z;Request URL is missing an 'http://' or 'https://' protocol.z)Request URL has an unsupported protocol 'z://'.r*   poolNr,   )streampool_requestrc   )statusr]   Zcontent
extensions)ZhttpZhttpsZwsZwss)r[   r\   Zdecoder   rg   ZgetrR   r   rQ   append_assign_requests_to_connections_close_connectionsr-   handle_async_requestr   r   r)   BaseExceptionremover
   rf   r]   PoolByteStreamrd   )
r!   r   r\   Ztimeoutsr*   re   closingr   Zresponseexcs
   &&        r   rk   Z(AsyncConnectionPool.handle_async_request   s     ##**,R<%M  77%;F85I  %%)))R8,,vt,'''+G4LNN!!,/ (
!	 /// #BBDG 0 --g666 $0#C#CG#C#TT
%/%D%D$,,&  H  ??$$"\  **
 	
W (' 0/ 7 U  . 4
 !11334  	 +++ %%l3>>@	 ,+++ ))'2224	 s   BI$'F	8I$G F'G F/G F1G #F5 F3F5 AI$	F	I$F,	'	G 1G 3F5 5GG GG I!#I7,H,#	I,H<7IIII!!I$c               r%   r_   r   r   r   r   r   rB     s     E# E#1O E#r   c                s*   . p\        V P                  4       EF  pVP                  4       '       d   V P                  P                  V4       K7  VP	                  4       '       d/   V P                  P                  V4       VP                  V4       K{  VP                  4       '       g   K  \        V P                   Uu. uF  q"P                  4       NK  	  up4      V P                  8  g   K  V P                  P                  X4       VP                  V4       EK  	  V P                   Uu. uF  q3P                  4       '       g   K  VNK  	  ppV EF  pVP                  P                  P                  pV P                   Uu. uF6  pVP                  V4      '       g   K  VP                  4       '       g   K4  VNK8  	  ppV P                   Uu. uF  q"P                  4       '       g   K  VNK  	  ppV'       d   V^ ,          pVP!                  V4       K  \        V P                  4      V P"                  8  dA   V P%                  V4      pV P                  P                  V4       VP!                  V4       EK*  V'       g   EK5  V^ ,          pV P                  P                  V4       VP                  V4       V P%                  V4      pV P                  P                  V4       VP!                  V4       EK  	  V# u upi u upi u upi u upi )a  
Manage the state of the connection pool, assigning incoming
requests to connections as available.

Called whenever a new request is added or removed from the pool.

Any closing connections are returned, allowing the I/O for closing
those connections to be handled seperately.
)ra   rP   Z	is_closedrm   Zhas_expiredrh   is_idleZlenrG   rQ   r/   r   r[   rS   Zcan_handle_requestZis_availabler$   rF   r^   )	r!   closing_connectionsr   r   Zqueued_requestsre   rS   Zavailable_connectionsZidle_connectionss	   &        r   ri   Z3AsyncConnectionPool._assign_requests_to_connections  s    ! t001J##%%!!((4''))!!((4#**:6""$$@Q@QR@Q*++-@QRS112 !!((4#**:6 2$ 37..X.wDUDUDW77.X+L!))--44F #'"3"3%"3J008 =G=T=T=V 
"3 " % .2->-> ->zBTBTBV

->    %215
11*=T&&'$*?*??!33F;
!!((411*=!!-a0
!!((4#**:6!33F;
!!((411*=E ,H #"[ S Y%
 s0   >L
-L	LL#L;LL-Lc               r   )r   ro   r`   r   r   r   r   r   r   r   rB   U  s     * *0N *SW *r   c                	s   "   \        4       ;_uu_ 4        V F  pVP                  4       G R j  xL
  K  	  R R R 4       R #  L  + '       g   i     R # ; i5ir   )r   aclose)r!   ro   r   s   && r   rj   Z&AsyncConnectionPool._close_connectionsU  s@     $&&%
 ''))) & '&) '&&s+   AAA
A
AAA		Ac               r%   r&   r   r   r   r   r   rB   [  s     ; ;d ;r   c                	s   "   V P                   ;_uu_ 4        \        V P                  4      p. V n        R R R 4       V P                  X4      G R j  xL
  R #   + '       g   i     L+; i L5ir   )rR   ra   rP   rj   )r!   rr      & r   rs   ZAsyncConnectionPool.aclose[  sV      '''"&t'8'8"9 "D ( %%&9::: (' 	;s'   A,AA,A*A,A'	"	A,c               r%   )r   r   r5   r   r   r   r   r   rB   c  s      "5 r   c                	s   "   V # 5ir   r   r'   r(   r   
__aenter__ZAsyncConnectionPool.__aenter__c  s
     s   c               (    V ^8  d   QhRRRRRRRR/# )	r   exc_typeztype[BaseException] | None	exc_valuezBaseException | None	tracebackztypes.TracebackType | Noner   r   r   r   r   r   r   rB   f  s2      , ( .	
 
r   c                	sB   "   V P                  4       G R j  xL
  R #  L5ir   )rs   )r!   rw   rx   ry      &&&&r   	__aexit__ZAsyncConnectionPool.__aexit__f  s      kkms   c               r%   )r   r   Zstrr   r   r   r   r   rB   n  s     G G# Gr   c                	s   V P                   P                  pV P                  ;_uu_ 4        V P                   Uu. uF  q"P	                  4       NK  	  ppV P
                   Uu. uF  qDP                  4       NK  	  ppVP                  R 4      pVP                  R4      pVP                  R 4      pVP                  R4      p	RRR4       RX RX R2p
RX RX	 R2pRV R	V
 R
V R2# u upi u upi   + '       g   i     L8; i)FTNz
Requests: z	 active, z queuedzConnections: z idleZ<z [z | z]>)Z	__class__r0   rR   rQ   r/   rP   rq   Zcount)r!   Z
class_namer   Zrequest_is_queuedr   Zconnection_is_idleZnum_active_requestsZnum_queued_requestsZnum_active_connectionsZnum_idle_connectionsZrequests_infoZconnection_infos   &           r   __repr__ZAsyncConnectionPool.__repr__n  s   ^^,,
'''DHNN SN!2!2!4N S7;7H7H"7H""$7H  " #4"9"9%"@"3"9"9$"?%7%=%=e%D"#5#;#;D#A  ( ,-Y7J6K7S 	 239=Q<RRWX 	 :,bs?2C2FF# !T" ('s)   C0C&C0"C+:AC0&
C00D 	)rP   rI   rJ   rH   rL   rF   rG   rN   rR   rD   rQ   rK   rO   rC   rM   )NNi
   NNTFr    NNNN)NNN)r0   r1   r2   r3   Z__doc__r#   r^   Zpropertyrb   rk   ri   rj   rs   ru   r{   r|   r4   r   r   r   r5   r5   +   sV    N7`3
j ' '"E
NE#N*;G Gr   r5   c                  s:    ] tR tRtR R ltR R ltR R ltRtR	# )
rn   i  c               rv   )	r   rd   ztyping.AsyncIterable[bytes]re   r   rc   r5   r   r   r   r   r   r   r   PoolByteStream.__annotate__  s2     	 	+	 '	 "		
 
	r   c                	s8    Wn         W n        W0n        R V n        R# )FN)_stream_pool_request_pool_closed)r!   rd   re   rc   rz   r   r#   ZPoolByteStream.__init__  s     )
r   c               r%   )r   r   ztyping.AsyncIterator[bytes]r   r   r   r   r   r}     s        !<  r   c               	s   "    V P                     R j  xL
  pV5x  K   LDR #   \         d"   pT P                  4       G R j  xL 
  TR hR p?ii ; i5ir   )r~   rl   rs   )r!   Zpartrp   s   &  r   	__aiter__ZPoolByteStream.__aiter__  sO     	 "ll  d
l 	 ++-4	 sH   A& #!#	& #& AAAAAAAc               r%   r&   r   r   r   r   r   r}     s     9 9d 9r   c                	sp  "   V P                   '       g   R V n         \        4       ;_uu_ 4        \        V P                  R4      '       d#   V P                  P	                  4       G Rj  xL
  RRR4       V P
                  P                  ;_uu_ 4        V P
                  P                  P                  V P                  4       V P
                  P                  4       pRRR4       V P
                  P                  X4      G Rj  xL
  R# R#  L  + '       g   i     L; i  + '       g   i     LL; i L05i)Trs   N)r   r   Zhasattrr~   rs   r   rR   rQ   rm   r   ri   rj   )r!   ro   rt   r   rs   ZPoolByteStream.aclose  s     |||DL(**4<<22,,--/// + 111

$$++D,>,>?**DDF 2 **//888  0 +* 21 9sS   ,D6:D(D)D-&D6A
D!&D6D4D6DD	D6!D1	,	D6)r   r   r   r~   N)r0   r1   r2   r3   r#   r   rs   r4   r   r   r   rn   rn     s    	 9 9r   rn   )Z
__future__r   ZsslrE   ZtypesZtypingZ_backends.autor   Z_backends.baser   r   Z_exceptionsr   r   Z_modelsr   r   r	   r
   Z_synchronizationr   r   r   r   r   Z
interfacesr   r   r   r5   rn   r   r   r   <module>r      sU    " 
 
   ( ? E 6 6 S S + G' '4WG/ WGt
9 9r   