
    i
                     (   S SK r S SKrS SKrS SKJrJrJrJr  \R                  " \5      r	\R                  R                  5        V Vs0 s H7  u  pU R                  S5      (       d  M  U R                  S5      (       a  M5  X_M9     snn rS rgs  snn f )    N)signalSIGINTSIGTERMSIGABRTSIGSIG_c                  
  ^#    SmU4S jn [         [        [        4 H  n[        X5        M      [        R
                  " [        R                  " S5      5      m TI Sh  vN   M7   N! [        R                   a     gf = f7f)ab  Block the main script execution until a signal is received.

This function will run indefinitely in order to block the main script execution and prevent it from
exiting while having client(s) that are still running in the background.

It is useful for event-driven application only, that are, applications which react upon incoming Telegram
updates through handlers, rather than executing a set of methods sequentially.

Once a signal is received (e.g.: from CTRL+C) the function will terminate and your main script will continue.
Don't forget to call :meth:`~pyrogram.Client.stop` for each running client before the script ends.

Example:
    .. code-block:: python

        import asyncio
        from pyrogram import Client, idle


        async def main():
            apps = [
                Client("account1"),
                Client("account2"),
                Client("account3")
            ]

            ...  # Set up handlers

            for app in apps:
                await app.start()

            await idle()

            for app in apps:
                await app.stop()


        asyncio.run(main())
Nc                 f   > [         R                  S[        U     S35        TR                  5         g )NzStop signal received (z). Exiting...)loginfosignalscancel)signum__tasks     L/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/utilities/idle.pysignal_handleridle.<locals>.signal_handlerJ   s'    )'&/):-HI    iX  )r   r   r   	signal_fnasynciocreate_tasksleepCancelledError)r   sr   s     @r   idler   !   sy     N D gw'!$ ( ""7==#56	JJ	  %% 		s<   ABA)  A'!A) %B'A) )B =B?B  B)r   loggingr   r   r   r   r   	getLogger__name__r   __dict__items
startswithr   r   )vks   00r   <module>r%      s   &    @ @! __**,,TQ||E 	#$<<#7 	AD,6s   B(B B