def spawn_after(seconds, *args, **kwargs):
raise_error = kwargs.pop('raise_error', False)
def _launch(func, *args, **kwargs):
# Mimic gevent's default raise_error=False behaviour
# by not propagating an exception to the joiner.
try:
return func(*args, **kwargs)
except TaskExit:
pass
except:
if raise_error:
raise
# Log uncaught exception.
# Note: this is an intentional divergence from gevent
# behaviour; gevent silently ignores such exceptions.
LOG.error('hub: uncaught exception: %s',
traceback.format_exc())
return eventlet.spawn_after(seconds, _launch, *args, **kwargs)
评论列表
文章目录