o
    -˜Žj	  ã                   @   sF   d dl Z d dlmZ d dlZddlmZ 	dded defd	d
„ZdS )é    N)ÚListé   )ÚidleFÚclientszpyrogram.ClientÚ
sequentialc                 Ã   s„   �|r| D ]	}|  ¡ I dH  qntjdd„ | D ƒŽ I dH  tƒ I dH  |r3| D ]	}| ¡ I dH  q'dS tjdd„ | D ƒŽ I dH  dS )a¡  Run multiple clients at once.

    This method can be used to run multiple clients at once and can be found directly in the ``pyrogram`` package.

    If you want to run a single client, you can use Client's bound method :meth:`~pyrogram.Client.run`.

    Parameters:
        clients (List of :obj:`~pyrogram.Client`):
            A list of client objects to run.

        sequential (``bool``, *optional*):
            Pass True to run clients sequentially.
            Defaults to False (run clients concurrently)

    Example:
        .. code-block:: python

            import asyncio
            from pyrogram import Client, compose


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

                ...

                await compose(apps)


            asyncio.run(main())

    Nc                 S   ó   g | ]}|  ¡ ‘qS © )Ústart©Ú.0Úcr   r   ú_/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/utilities/compose.pyÚ
<listcomp>G   ó    zcompose.<locals>.<listcomp>c                 S   r   r   )Ústopr
   r   r   r   r   O   r   )r	   ÚasyncioÚgatherr   r   )r   r   r   r   r   r   Úcompose   s   €(ÿÿr   )F)r   Útypingr   Úpyrogramr   Úboolr   r   r   r   r   Ú<module>   s   þÿþ