async def handle(self):
        """
        Listens on all the provided channels and handles the messages.
        """
        # For each channel, launch its own listening coroutine
        listeners = []
        for key, value in self.beat_config.items():
            listeners.append(asyncio.ensure_future(
                self.listener(key)
            ))


        # For each beat configuration, launch it's own sending pattern
        emitters = []
        for key, value in self.beat_config.items():
            emitters.append(asyncio.ensure_future(
                self.emitters(key, value)
            ))

        # Wait for them all to exit
        await asyncio.wait(emitters)
        await asyncio.wait(listeners)
async def handle ( self ) : listeners = [ ] for key , value in self . beat_config . items ( ) : listeners . append ( asyncio . ensure_future ( self . listener ( key ) ) ) emitters = [ ] for key , value in self . beat_config . items ( ) : emitters . append ( asyncio . ensure_future ( self . emitters ( key , value ) ) ) await asyncio . wait ( emitters ) await asyncio . wait ( listeners )
Listens on all the provided channels and handles the messages.