mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
* log * tests * snapshot tests * change to richlog * keep raw lines * disable highlighting by default * simplify * superfluous test * optimization * update cell length * add refresh * write method * version bump * doc fix link * makes lines private * docstring * relax dev dependancy * remove superfluous code [skip ci] * added FAQ [skipci] * fix code in faq [skipci] * fix typo * max lines fix
667 B
667 B
title, alt_titles
| title | alt_titles | ||
|---|---|---|---|
| How do I fix WorkerDeclarationError? |
|
Textual version 0.31.0 requires that you set thread=True on the @work decorator if you want to run a threaded worker.
If you want a threaded worker, you would declare it in the following way:
@work(thread=True)
def run_in_background():
...
If you don't want a threaded worker, you should make your work function async:
@work()
async def run_in_background():
...
This change was made because it was too easy to accidentally create a threaded worker, which may produce unexpected results.