def asyncClose(fn):
@functools.wraps(fn)<EOL>def wrapper(*args, **kwargs):<EOL><INDENT>f = asyncio.ensure_future(fn(*args, **kwargs))<EOL>while not f.done():<EOL><INDENT>QApplication.instance().processEvents()<EOL><DEDENT><DEDENT>return wrapper<EOL>
Allow to run async code before application is closed.