+
    }i|                        ^ RI Ht ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHtHt ^ R	IHt ^ R
IHtHt ^ RIHtHt ]'       d   ^ RIHt ^ RIHt ]! ]4      t]
! R4       ! R R]4      4       tR# )    )annotationsN)	timedelta)	getLogger)TYPE_CHECKING)
docs_group)RecurringTask)get_cpu_infoget_memory_info)Configuration)EventManagerEventManagerOptions)EventEventSystemInfoData)TracebackType)UnpackzEvent managersc                     a  ] tR t^tRt]! ^R7      3R V 3R lllt]RR R ll4       tR V 3R llt	R	 V 3R
 llt
R R ltRtV ;t# )LocalEventManagera  Event manager for local environments.

It extends the `EventManager` to emit `SystemInfo` events at regular intervals. The `LocalEventManager`
is intended to be used in local environments, where the system metrics are required managing the `Snapshotter`
and `AutoscaledPool`.
)secondsc               $    V ^8  d   QhRRRRRR/# )   system_info_intervalr   event_manager_optionszUnpack[EventManagerOptions]returnNone )formats   "u/Users/ahmad/.openclaw/workspace/my-crawler/.venv/lib/python3.14/site-packages/crawlee/events/_local_event_manager.py__annotate__LocalEventManager.__annotate__"   s(     2 2'2 "=2 
	2    c                   < Wn         \        V P                  V P                   R7      V n        \        SV `  ! R/ VB  R# )a.  Initialize a new instance.

In most cases, you should use the `from_config` constructor to create a new instance based on
the provided configuration.

Args:
    system_info_interval: Interval at which `SystemInfo` events are emitted.
    event_manager_options: Additional options for the parent class.
)funcdelayNr   )_system_info_intervalr   _emit_system_info_event _emit_system_info_event_rec_tasksuper__init__)selfr   r   	__class__s   &&,r   r(   LocalEventManager.__init__"   s?     &:" 1>--,,1
-
 	101r    c                    V ^8  d   QhRRRR/# )r   configzConfiguration | Noner   r   r   )r   s   "r   r   r   ;   s     
 
!5 
AR 
r    c                |    T;'       g    \         P                  ! 4       pV ! VP                  VP                  R7      # )zInitialize a new instance based on the provided `Configuration`.

Args:
    config: The `Configuration` instance. Uses the global (default) one if not provided.
)r   persist_state_interval)r   get_global_configurationr   r/   )clsr-   s   &&r   from_configLocalEventManager.from_config:   s9     CC=AAC!'!<!<#)#@#@
 	
r    c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   H   s      "3 r    c                t   <"   \         SV `  4       G Rj  xL
  V P                  P                  4        V #  L 5i)zInitialize the local event manager upon entering the async context.

It starts emitting system info events at regular intervals.
N)r'   
__aenter__r&   start)r)   r*   s   &r   r6   LocalEventManager.__aenter__H   s5     
 g """--335 	#s   86!8c               (    V ^8  d   QhRRRRRRRR/# )	r   exc_typeztype[BaseException] | None	exc_valuezBaseException | Noneexc_tracebackzTracebackType | Noner   r   r   )r   s   "r   r   r   Q   s8     D D,D (D ,	D
 
Dr    c                   <"   V P                   P                  4       G Rj  xL
  \        SV `  WV4      G Rj  xL
  R#  L L5i)zClose the local event manager upon exiting the async context.

It stops emitting system info events and closes the event manager.
N)r&   stopr'   	__aexit__)r)   r:   r;   r<   r*   s   &&&&r   r?   LocalEventManager.__aexit__Q   s=      3388:::g]CCC 	;Cs   AA AAAAc                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   ^   s     B Bt Br    c                   "   \         P                  ! \        4      G Rj  xL
 p\         P                  ! \        4      G Rj  xL
 p\	        WR7      pV P                  \        P                  VR7       R#  LU L55i)z?Emit a system info event with the current CPU and memory usage.N)cpu_infomemory_info)event
event_data)asyncio	to_threadr	   r
   r   emitr   SYSTEM_INFO)r)   rC   rD   rF   s   &   r   r%   )LocalEventManager._emit_system_info_event^   sS      **<88#--o>>((T
		))j	A	 9>s!   A:A6!A:A84A:8A:)r&   r$   )N)__name__
__module____qualname____firstlineno____doc__r   r(   classmethodr2   r6   r?   r%   __static_attributes____classcell__)r*   s   @r   r   r      sR     +4A*>2 20 
 
 D DB Br    r   )
__future__r   rG   datetimer   loggingr   typingr   crawlee._utils.docsr   crawlee._utils.recurring_taskr   crawlee._utils.systemr	   r
   crawlee.configurationr   crawlee.events._event_managerr   r   crawlee.events._typesr   r   typesr   typing_extensionsr   rL   loggerr   r   r    r   <module>ra      sb    #      * 7 ? / K <#(	8	 JB JB JBr    