Skip to content

Markdown update doesn't work with Threaded Workers #2853

Answered by davep
jimbob88 asked this question in Q&A
Discussion options

You must be logged in to vote

You may want to take a look at the final paragraph in the worker docs:

Most Textual functions are not thread-safe which means you will need to use call_from_thread to run them from a thread worker. An exception would be post_message which is thread-safe. If your worker needs to make multiple updates to the UI, it is a good idea to send custom messages and let the message handler update the state of the UI.

In other words, the best thing for you to do here would be to either use call_from_thread or to send a message up to request that the update is performed.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jimbob88
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
Converted from issue

This discussion was converted from issue #2852 on June 27, 2023 16:38.