Skip to content

Instantly share code, notes, and snippets.

@tcatm
Created May 30, 2015 21:51
Show Gist options
  • Save tcatm/e7f4e2f847f61379075a to your computer and use it in GitHub Desktop.
Save tcatm/e7f4e2f847f61379075a to your computer and use it in GitHub Desktop.
def wrap_housekeeping(f):
def inner(self, *args):
d = None
try:
ret = f(self, *args)
except Exception as e:
d = e
self.loop.create_task(self.housekeeping())
if d:
raise d
return ret
return inner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment