You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How does this example work? closeEvent is not referenced from anywhere. It's the same on the README example.
What I want: I have an app with some async tasks running. When the user closes the app, I want to app to cancel() all of the async tasks and then exit after all of the cancellations are done().
The text was updated successfully, but these errors were encountered:
When the user closes the app, I want to app to cancel() all of the async tasks and then exit after all of the cancellations are done().
I figured out how to do with without asyncClose. It looks like this:
self._app_close_event=asyncio.Event()
asyncdefapp_run():
awaitself._app_close_event.wait()
self._render_engine._delete_component(self._root, True)
# At this time, all use_async hook tasks have been cancel()ed.# Wait until all the cancelled tasks are done(), then exit.whilelen(self._render_engine._hook_async) >0:
awaitasyncio.sleep(0.0)
loop.run_until_complete(app_run())
I'm still curious what the use-case is for asyncClose?
I'm trying to understand how to use
asyncClose
.qasync/examples/aiohttp_fetch.py
Lines 45 to 47 in a6eb8e5
How does this example work?
closeEvent
is not referenced from anywhere. It's the same on the README example.What I want: I have an app with some async tasks running. When the user closes the app, I want to app to
cancel()
all of the async tasks and then exit after all of the cancellations aredone()
.The text was updated successfully, but these errors were encountered: