
    i
                          S SK r  " S S5      rg)    Nc                   2    \ rS rSr  S	SSS\S\4S jjrSrg)
Restart   selfzpyrogram.Clientblockclear_handlersc                    ^ ^#    UU 4S jnU(       a  U" 5       I Sh  vN   T $ T R                   R                  U" 5       5        T $  N(7f)aU  Restart the Client.

This method will first call :meth:`~pyrogram.Client.stop` and then :meth:`~pyrogram.Client.start` in a row in
order to restart a client using a single method.

Parameters:
    block (``bool``, *optional*):
        Blocks the code execution until the client has been restarted. It is useful with ``block=False`` in case
        you want to restart the own client within an handler in order not to cause a deadlock.
        Defaults to True.

    clear_handlers (``bool``, *optional*):
        Clear the already existing handlers on restart the client.
        Default to False.

Returns:
    :obj:`~pyrogram.Client`: The restarted client itself.

Raises:
    ConnectionError: In case you try to restart a stopped Client.

Example:
    .. code-block:: python

        import asyncio

        from pyrogram import Client


        async def main():
            app = Client("my_account")

            await app.start()
            ...  # Invoke API methods
            await app.restart()
            ...  # Invoke other API methods
            await app.stop()

        asyncio.run(main())
c                  t   >#    TR                  T S9I S h  vN   TR                  5       I S h  vN   g  N N7f)N)r   )stopstart)r   r   s   O/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/utilities/restart.pydo_itRestart.restart.<locals>.do_itE   s1     ))>):::**, ;s   848688N)loopcreate_task)r   r   r   r   s   ` ` r   restartRestart.restart   sA     \	 'MM  II!!%'*	 s   AA)A N)TF)__name__
__module____qualname____firstlineno__boolr   __static_attributes__r       r   r   r      s.     $777 7 7r   r   )pyrogramr   r   r   r   <module>r      s   & 8 8r   