o
    
{g                     @   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/bot.gig.net.ua/public_html/telegram/P1/HellBot/venv/lib/python3.10/site-packages/pyrogram/methods/utilities/compose.py
<listcomp>F       zcompose.<locals>.<listcomp>c                 S   r   r   )stopr
   r   r   r   r   N   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   