Skip to content
Discussion options

You must be logged in to vote

get_current_worker is a function for doing just that, getting the current worker; that is: getting the worker you're inside of. You can have multiple workers all running at the same time so from outside of any given worker there is no current worker.

You may want to have a read again of the parts of the guide to workers that deal with thread workers, it gives an example of calling get_current_worker, and also highlights the issue of thread safety; in your code above you're attempting to update widgets in a non-thread-safe way (not the issue here, but an issue you'll run into).

To cancel a specific worker from outside of it, my approach would be to give the worker a unique group name and t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@davep
Comment options

Answer selected by MuongKimhong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants