PrefectHQ
prefect
BlogDocsChangelog

Migrate task_worker.py from @sync_compatible to @async_dispatch

#20259
Comparing
migrate-task-worker-async-dispatch
(
b7805d4
) with
main
(
338d3bd
)
CodSpeed Performance Gauge
0%
Untouched
2
Ignored
6

Benchmarks

Passed

bench_import_prefect_flow
benches/bench_import.py
CodSpeed Performance Gauge
0%
1.4 s1.4 s
bench_task_decorator
benches/bench_tasks.py
CodSpeed Performance Gauge
0%
551.2 µs551.1 µs

Ignored

bench_task_call
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
+8%
25 ms23.1 ms
bench_flow_call[options0]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-1%
106.5 ms107.2 ms
bench_task_submit
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
+1%
90.4 ms89.9 ms
bench_flow_decorator
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-5%
4.8 ms5.1 ms
bench_import_prefect
benches/bench_import.py
Ignored
CodSpeed Performance Gauge
0%
1.1 s1.1 s
bench_flow_call[options1]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
107.4 ms107.7 ms

Commits

Click on a commit to change the comparison range
Base
main
338d3bd
+0.06%
Migrate task_worker.py from @sync_compatible to @async_dispatch Part of ongoing effort to remove @sync_compatible decorator (#15008). - Add explicit async methods: astart, astop, aserve - Decorate sync methods (start, stop, serve) with @async_dispatch - Sync implementations use from_sync.call_soon_in_loop_thread - Update handle_sigterm to call astop directly - Update tests to mock async methods when called from async context 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
b7805d4
12 hours ago
by zzstoatzz
© 2026 CodSpeed Technology
Home Terms Privacy Docs