Skip to content

Commit 17df56d

Browse files
committed
words
1 parent 21b763d commit 17df56d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/guide/workers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ This works well if you are using an async API like `httpx`, but if your API does
153153
You can create threads by setting `thread=True` on the `run_worker` method or the `work` decorator.
154154
The API for thread workers is identical to async workers, but there are a few differences you need to be aware of when writing code for thread workers.
155155

156-
The first difference is that you should avoid calling methods on your UI directly, or setting reactive variables.
157-
You can work around this with the [App.call_from_thread][textual.app.App.call_from_thread] method which schedules a call in the main thread.
156+
The first difference is that you should **avoid calling methods on your UI directly** from a threaded worker, or setting reactive variables.
157+
You can work around this with the [App.call_from_thread][textual.app.App.call_from_thread] method which runs your function from the main thread.
158158

159159
The second difference is that you can't cancel threads in the same way as coroutines, but you *can* manually check if the worker was cancelled.
160160

0 commit comments

Comments
 (0)