def run_for_time(self, duration: float=10.0) -> None:
        '''Execute the tasky/asyncio event loop for `duration` seconds.'''

        Log.debug('running event loop for %.1f seconds', duration)
        try:
            asyncio.ensure_future(self.init())
            self.loop.run_until_complete(asyncio.sleep(duration))
            self.terminate()
            self.loop.run_forever()

        except RuntimeError as e:
            if not e.args[0].startswith('Event loop stopped'):
                raise

        finally:
            self.loop.close()
def run_for_time ( self , duration : float = 10.0 ) -> None : Log . debug ( 'running event loop for %.1f seconds' , duration ) try : asyncio . ensure_future ( self . init ( ) ) self . loop . run_until_complete ( asyncio . sleep ( duration ) ) self . terminate ( ) self . loop . run_forever ( ) except RuntimeError as e : if not e . args [ 0 ] . startswith ( 'Event loop stopped' ) : raise finally : self . loop . close ( )
Execute the tasky/asyncio event loop for `duration` seconds.