How to terminate @work worker on app exit? #2839
-
I have a widget with a @work worker:
When exiting the application (app.exit()), python wait for my worker to finish... 1/ How could I kill that thread/worker? (stronger than cancel?) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I assumed that any workers would be cancelled on exiting the app? According to the docs for Worker lifetimes:
[EDIT: Sorry I've just spotted your example doesn't have the |
Beta Was this translation helpful? Give feedback.
I assumed that any workers would be cancelled on exiting the app? According to the docs for Worker lifetimes:
[EDIT: Sorry I've just spotted your example doesn't have the
async
keyword, so would actually create a thread worker. Just to double-check, is it specifically threaded code you are asking about?]