def _eager_tasklet ( tasklet ) : @ utils . wrapping ( tasklet ) def eager_wrapper ( * args , * * kwds ) : fut = tasklet ( * args , * * kwds ) _run_until_rpc ( ) return fut return eager_wrapper
python force lambda function to be eager
Decorator to turn tasklet to run eagerly .
def _eager_tasklet(tasklet):
  """Decorator to turn tasklet to run eagerly."""

  @utils.wrapping(tasklet)
  def eager_wrapper(*args, **kwds):
    fut = tasklet(*args, **kwds)
    _run_until_rpc()
    return fut

  return eager_wrapper