Skip to content

feat: support coroutine functions as invoke targets#611

Merged
fgmacedo merged 1 commit intodevelopfrom
feat/async-invoke-support
Apr 9, 2026
Merged

feat: support coroutine functions as invoke targets#611
fgmacedo merged 1 commit intodevelopfrom
feat/async-invoke-support

Conversation

@fgmacedo
Copy link
Copy Markdown
Owner

@fgmacedo fgmacedo commented Apr 9, 2026

Summary

Closes #610.

  • Coroutine functions passed as invoke targets were silently broken: the coroutine was never awaited and the coroutine object was passed as data in the done.invoke event
  • The async engine now detects coroutine callbacks (callback._iscoro) and IInvoke handlers with async def run() (_has_async_run()) and awaits them directly on the event loop instead of routing through run_in_executor
  • InvalidDefinition is raised when async IInvoke handlers are used with the sync engine (raw coroutine functions already auto-select the async engine via the callback detection pipeline)
  • Ignores local specs/ directory in .gitignore

Coroutine functions passed as invoke targets were silently broken: the
coroutine was never awaited and the coroutine object was passed as data
in the done.invoke event. Now the async engine detects coroutine
callbacks and IInvoke handlers with async run() and awaits them directly
on the event loop instead of routing through run_in_executor.

Also adds InvalidDefinition when async IInvoke handlers are used with
the sync engine, and ignores the local specs/ directory.

Signed-off-by: Fernando Macedo <fgmacedo@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 9, 2026

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b7a46e5) to head (8c24a42).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop      #611   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           42        42           
  Lines         5027      5027           
  Branches       812       812           
=========================================
  Hits          5027      5027           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fgmacedo fgmacedo added the bug label Apr 9, 2026
@fgmacedo fgmacedo added this to the 3.1.0 milestone Apr 9, 2026
@fgmacedo fgmacedo merged commit f54d9f5 into develop Apr 9, 2026
14 checks passed
@fgmacedo fgmacedo deleted the feat/async-invoke-support branch April 9, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does Invoke always run in a thread?

1 participant