-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set_loading in a @work function RunTimeError when using on_mount after release 0.82 #5137
Comments
There was a change to the loading indicator mechanism in v0.82.0, but the issue here is that you're directly setting a reactive inside a thread worker. There is a warning in the Worker docs that most Textual functions are not thread-safe:
|
Ok, tried it with |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
When setting
loading = True
in awork
thread, and running the thread from anon_mount
command aRuntimeError: no running event loop
is thrown. This only happens after release 0.82.Take the following code, and run it with textual version 0.82 or 0.83:
This results in the following stacktrace:
This does not occur in version 0.81 and prior. I have also confirmed this error happens on both Windows Python 3.11, and Debian Python 3.12.
The text was updated successfully, but these errors were encountered: