
    N[i                     F    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Zy)
    N)List   )idleclientszpyrogram.Client
sequentialc                   K   |r | D ]  }|j                          d{     n6t        j                  | D cg c]  }|j                          c}  d{    t                d{    |r | D ]  }|j	                          d{     yt        j                  | D cg c]  }|j	                          c}  d{    y7 c c}w 7 v7 f7 Ic c}w 7 w)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())

    N)startasynciogatherr   stop)r   r   cs      U/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/utilities/compose.pycomposer      s     P  	A'')OO	 nn':Qqwwy:;;;
&LL 	A&&(NN	 nn9Aqvvx9::: :; 9:sn   CCCCCCC(C)CCC"C9C CCCCCC)F)r
   typingr   pyrogramr   boolr        r   <module>r      s3   &    
 4;#$4;4;r   