Allow notifying the user about an upcoming shutdown #718
Replies: 2 comments 4 replies
-
Hi @HilkopterBob! async def bye():
for client in globals.clients.values():
with client:
ui.notify('Goodbye!')
app.on_shutdown(bye) But there's a problem: Async shutdown handlers are not awaited. Right after creating background tasks, the process is stopped. Thus the notification is added to the outbox queue, but is never emitted. @rodja What do you think? Should we await shutdown handlers? Creating tasks right before stopping the process doesn't make too much sense. By the way, this might be related to #297. |
Beta Was this translation helpful? Give feedback.
-
@HilkopterBob Maybe this is a possible workaround:
|
Beta Was this translation helpful? Give feedback.
-
Question
hey My app requires making major changes to the codebase on a regular basis. According to my tests, the changes are regularly too big for the nicegui hotreload to cope with. That's why I thought that it would be enough to inform users with a dialog that a shutdown is imminent. So now to my question: is it possible to write a "global" function so that all users on all pages and subpages are informed immediately about the shutdown?
Beta Was this translation helpful? Give feedback.
All reactions