def run_in_thread_pool(self, pool_size=None, func=None, *args):
        """If `kwargs` needed, try like this: func=lambda: foo(*args, **kwargs)"""
        executor = Pool(pool_size)
        return self.loop.run_in_executor(executor, func, *args)
def run_in_thread_pool ( self , pool_size = None , func = None , * args ) : executor = Pool ( pool_size ) return self . loop . run_in_executor ( executor , func , * args )
If `kwargs` needed, try like this: func=lambda: foo(*args, **kwargs)