U
    ç;ãg¸  ã                   @   sB   d dl Z d dlmZ d dlZddlmZ d
ed edœdd	„ZdS )é    N)ÚListé   )ÚidleFzpyrogram.Client)ÚclientsÚ
sequentialc                 Ã   s€   |r| D ]}|  ¡ I dH  qntjdd„ | D ƒŽ I dH  tƒ I dH  |rb| D ]}| ¡ I dH  qLn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   s   g | ]}|  ¡ ‘qS © )Ústart©Ú.0Úcr   r   úb/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/utilities/compose.pyÚ
<listcomp>F   s     zcompose.<locals>.<listcomp>c                 S   s   g | ]}|  ¡ ‘qS r   )Ústopr	   r   r   r   r   N   s     )r   ÚasyncioZgatherr   r   )r   r   r   r   r   r   Úcompose   s    (r   )F)r   Útypingr   Zpyrogramr   Úboolr   r   r   r   r   Ú<module>   s    þþ