def submit ( self , fn , * args , * * kwargs ) : corofn = asyncio . coroutine ( lambda : fn ( * args , * * kwargs ) ) return run_coroutine_threadsafe ( corofn ( ) , self . loop )
python coroutine call coroutine
Submit an operation
def submit(self, fn, *args, **kwargs):
        """Submit an operation"""
        corofn = asyncio.coroutine(lambda: fn(*args, **kwargs))
        return run_coroutine_threadsafe(corofn(), self.loop)