Skip to content

Commit cd52455

Browse files
committed
docs: add a note to example about using worker startup event
1 parent 07dd9f9 commit cd52455

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def execute(self, query: str):
4242

4343

4444
@app.on_worker_startup()
45+
# NOTE: This event is triggered internally, do not use unless you know what you're doing
4546
def worker_startup(worker_state: TaskiqState): # NOTE: You need the type hint to load worker state
4647
# NOTE: Worker state is per-worker, not shared with other workers
4748
# NOTE: Can put anything here, any python object works

0 commit comments

Comments
 (0)