Workers ain't ... working for me #3401
valerio-afk
started this conversation in
General
Replies: 2 comments 1 reply
-
I assume your |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi both, Thanks a lot for your suggestions and link to resources. Cheers! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have very recently got to know Textual and of course I am giving a try by making a wee project (well, it's getting bigger than I thought, but just because I was unaware of the potential of this API).
I show you a code snippet below :
With this configuration, the compare_tree function (which is very looong), runs synchronously. The interface freezes but I hear my CPU fan spinning. I tried with and without the decorator (when using the decorator, I also get rid of the this.run_worker). Nothing, it doesn't work. The only way I got it to work is to set threaded=True. Although it works, I cannot make it stop, meaning that the w.cancel() doesn't work. I am sure that the code gets into that call, because I debugged it a little bit.
Long story short:
if threaded=False, doesn't run asynchronously.
if threaded=True, does run asynchronously. but cannot get it cancelled.
Any ideas? I am nearly sure that I am the problem here. However, I am following the tutorial, the examples, but I cannot see where my mistake is.
Beta Was this translation helpful? Give feedback.
All reactions