Skip to content

✨ Async support optionally using anyio#340

Closed
skeletorXVI wants to merge 48 commits into
fastapi:masterfrom
skeletorXVI:feature/anyio-support
Closed

✨ Async support optionally using anyio#340
skeletorXVI wants to merge 48 commits into
fastapi:masterfrom
skeletorXVI:feature/anyio-support

Conversation

@skeletorXVI

@skeletorXVI skeletorXVI commented Nov 19, 2021

Copy link
Copy Markdown

I took a shot at supporting async as discussed in #88 while integrated feedback from the issue #88 and PR #332 . Unlike the existing proposal I decided to support both sync and async commands from the same decorator, as I don't see a reason to use two identical decorator functions.

anyio is listed as an extra dependency. When anyio is not installed, asyncio is used, When anyio and trio are installed, the default engine becomes trio.

Other async engines, or customized behavior can be used by providing a custom run function via the async_runner parameter to the decorator or Typer instance.

  • Support asyncio, anyio and trio
  • Anyio is only an optional dependency
  • Autocompletion works as expected
  • Updated documentation
  • Added unit tests

@github-actions

This comment was marked as outdated.

@codecov

This comment was marked as outdated.

@pythonwood pythonwood mentioned this pull request Feb 24, 2023
4 tasks
@dekoza

dekoza commented Jul 2, 2023

Copy link
Copy Markdown

@tiangolo will this reach main? 😅

# Conflicts:
#	pyproject.toml
#	tests/test_completion/test_completion.py
#	tests/test_completion/test_completion_install.py
#	tests/test_completion/test_completion_show.py
#	typer/main.py
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as resolved.

@github-actions github-actions Bot removed the conflicts Automatically generated when a PR has a merge conflict label Sep 2, 2025
@github-actions

This comment was marked as outdated.

Comment thread .github/workflows/test.yml Outdated
@github-actions

This comment was marked as outdated.

Comment thread docs/tutorial/async.md Outdated
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions github-actions Bot added the conflicts Automatically generated when a PR has a merge conflict label Sep 9, 2025
@github-actions

This comment was marked as resolved.

@svlandeg svlandeg removed their assignment Nov 4, 2025
@github-actions github-actions Bot removed the conflicts Automatically generated when a PR has a merge conflict label Nov 19, 2025
@github-actions github-actions Bot added the conflicts Automatically generated when a PR has a merge conflict label Nov 24, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has a merge conflict that needs to be resolved.

@svlandeg svlandeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick note here that if we want to progress with this PR at some point, we should update the tutorial examples to use Typer() explicitely, as in #1418.

@tiangolo

Copy link
Copy Markdown
Member

Thanks for the interest here! ☕

There's a bunch of refactors we'll need to do first which will affect this, e.g. create conflicts, alter the design, etc. So it will be better to start again later at the right time.

I have been avoiding closing PRs before I have an alternative to provide, but then I've left them open for too long, sorry for that.

For now, I'll close this one for cleanup. But we'll continue tracking this internally to work on it again once what's needed underneath is ready. Thanks! 🍰

@tiangolo tiangolo closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts Automatically generated when a PR has a merge conflict feature New feature, enhancement or request p3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants