Skip to content

Support async command callbacks#3419

Closed
Jjas0n507 wants to merge 1 commit into
pallets:mainfrom
Jjas0n507:feature/async-command-callbacks
Closed

Support async command callbacks#3419
Jjas0n507 wants to merge 1 commit into
pallets:mainfrom
Jjas0n507:feature/async-command-callbacks

Conversation

@Jjas0n507
Copy link
Copy Markdown

Refs #2033

  • Run awaitable results from command callbacks with asyncio.run (including @pass_context wrapping async def).
  • Lazy-import asyncio inside the helper to satisfy test_light_imports.
  • Close coroutine objects when a loop is already running to avoid leaks / warnings.
  • Add tests/test_async_commands.py and document async callbacks in the quickstart.

Made with Cursor

- Run awaitable results from command callbacks with asyncio.run
- Close coroutine when a loop is already running to avoid leaks
- Lazy-import asyncio inside the helper to satisfy light-import tests

Refs pallets#2033

Co-authored-by: Cursor <cursoragent@cursor.com>
@davidism davidism closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants