+
    jHàj·
  ã                   ón   € R t ^ RIt^ RIt^ RIHtHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt R tR]/R	 ltR# )
zGCoalesce concurrent synchronous HTTP reads before threadpool admission.N)ÚpartialÚwraps)ÚWeakKeyDictionary)Úget_type_hints)Úrun_sync)Úget_hermes_homec                 óž  € \        V \        4      '       d,   \        V 4      \        R  V P	                  4        4       4      3# \        V \
        \        34      '       d%   \        V 4      \        \        \        V 4      4      3# \        V \        \        34      '       d%   \        V 4      \        \        \        V 4      4      3# \        V 4      V 3# )c              3   óR   "  € T F  w  r\        V4      \        V4      3x € K  	  R # 5i©N)Ú_freeze)Ú.0ÚkÚvs   &  ÚC/home/ubuntu/.hermes/hermes-agent/hermes_cli/web_read_coalescing.pyÚ	<genexpr>Ú_freeze.<locals>.<genexpr>   s   é € Ð&ZÉMÁDÀA¬°«
´G¸A³JÕ'?ËMùs   ‚%')
Ú
isinstanceÚdictÚtypeÚ	frozensetÚitemsÚlistÚtupleÚmapr   Úset)Úvalues   &r   r   r      s—   € Ü�%œ×ÒÜ�U“œYÑ&ZÈEÏKÉKÌMÓ&ZÓZÐ[Ð[Ü�%œ$¤˜×'Ò'Ü�U“œU¤3¤w°Ó#6Ó7Ð8Ð8Ü�%œ#œyÐ)×*Ò*Ü�U“œY¤s¬7°EÓ':Ó;Ð<Ð<Ü�‹K˜ÐÐó    Úthread_runnerc               óÌ  a aaa€ \         P                  ! S 4      o\        S RR7      pSP                  SP                  P                  4        Uu. uF9  pVP                  VP                  VP                  VP                  4      R7      NK;  	  upVP                  RSP                  4      R7      o\        4       o\        S 4      V VVV3R l4       pSVn        W$n        V# u upi )a¢  Return an async, in-flight-only wrapper around a synchronous read.

One worker per decorated function/event loop; identical home + bound
arguments share its result. Arguments must be hashable or built-in
containers of hashable values and must not be mutated during the read.
A custom async thread_runner must await the supplied zero-argument callable
through a context-preserving threadpool, not abandon running work.
T)Úinclude_extras)Ú
annotationÚreturn)Ú
parametersÚreturn_annotationc            	   Ÿ   ó  <a aaaaa"  € \         P                  ! 4       oS
P                  ! S / SB pVP                  4        \	        \        4       4      \        VP                  4      3oSP                  S/ \         P                  ! ^4      34      w  ooSP                  S4      pVf<   VV V	VVVVVV3	R lpSP                  V! 4       4      pVSS&   VP                  R 4       \         P                  ! V4      G Rj  x€L
 #  L5i)é   Nc            	   “   óö  <	"  €  S ;_uu_4       GR j  x€L
  S! \        S.SO5/ SB 4      G R j  x€L
 uuR R R 4      GR j  x€L
  SP                  SR 4       S'       g   SP                  SR 4       # #  L` LE L6  + GR j  x€L 
 '       g   i     M; i SP                  SR 4       S'       g   SP                  SR 4       R # R #   SP                  SR 4       S'       g   SP                  SR 4       i i ; i5ir
   )r   Úpop)	Ú	admissionÚargsÚfuncÚkeyÚkwargsÚloopÚpendingÚstatesr   s	   €€€€€€€€€r   ÚexecuteÚ0coalesced_read.<locals>.wrapped.<locals>.execute1   s¾   øé € ð/ß(ŸyšyÙ%2´7¸4Ð3QÀ$Ò3QÈ&Ñ3QÓ%R×R÷  )Ÿy™yð —K‘K  TÔ*ß"ØŸ
™
 4¨Õ.ð #ñ	  )ÙR÷  )ŸyŸyšyú˜yð —K‘K  TÔ*ß"ØŸ
™
 4¨Ö.ñ #øð —K‘K  TÔ*ß"ØŸ
™
 4¨Õ.ð #üs‚   ƒC9…C “A4”C —A:°A6±A:´C ÁA8ÁC Á.C9Á4C Á6A:Á8C Á:B	Â BÂ
B	ÂB	ÂC ÂC9Â1C9Ã/C6Ã6C9c                 óR   € V P                  4       '       d   R # V P                  4       # r
   )Ú	cancelledÚ	exception)Údones   &r   Ú<lambda>Ú1coalesced_read.<locals>.wrapped.<locals>.<lambda><   s   € ¸¿¹×8HÒ8H°Ð0^ÈdÏnÉnÓN^Ð0^r   )ÚasyncioÚget_running_loopÚbindÚapply_defaultsÚstrr   r   Ú	argumentsÚ
setdefaultÚ	SemaphoreÚgetÚcreate_taskÚadd_done_callbackÚshield)r)   r,   ÚboundÚtaskr0   r(   r+   r-   r.   r*   Ú	signaturer/   r   s   jl   @@@@€€€€r   ÚwrappedÚcoalesced_read.<locals>.wrapped(   sÓ   þé € ä×'Ò'Ó)ˆØ—’ Ð/¨Ñ/ˆØ×ÑÔÜ”?Ó$Ó%¤w¨u¯©Ó'?Ð@ˆØ#×.Ñ.¨t°b¼'×:KÒ:KÈAÓ:NÐ5OÓPÑˆ�Ø�{‰{˜3ÓˆØŠ<÷/õ /ð ×#Ñ#¡G£IÓ.ˆDØˆG�C‰Là×"Ñ"Ñ#^Ô_ä—^’^ DÓ)×)Ð)Ñ)ùs   ‰C4DÃ=DÃ>D)ÚinspectrF   r   Úreplacer"   Úvaluesr@   Únamer    r#   r   r   Ú__signature__Ú__annotations__)r*   r   ÚhintsÚprG   rF   r/   s   fd   @@r   Úcoalesced_readrQ      sÍ   û€ ô ×!Ò! $Ó'€IÜ˜4°Ô5€EØ×!Ñ!à&×1Ñ1×8Ñ8Ô:ó<Ù:˜ð —I‘I¨¯©°1·6±6¸1¿<¹<Ó)H�IÖIÙ:ñ<àŸ)™) H¨i×.IÑ.IÓJð "ó €Iô
 Ó €Fä
ˆ4ƒ[÷*ó ð*ð. &€GÔØ#ÔØ€NùòA<s   Á?C!)Ú__doc__r8   rI   Ú	functoolsr   r   Úweakrefr   Útypingr   Úanyio.to_threadr   Úhermes_constantsr   r   rQ   © r   r   Ú<module>rY      s.   ðÙ MÛ Û ß $Ý %Ý !å $Ý ,ò ð,¨(ö ,r   