Skip to content

Feat/add dependencies#97

Merged
jackburridge merged 11 commits into
mainfrom
feat/add-dependencies
Feb 12, 2026
Merged

Feat/add dependencies#97
jackburridge merged 11 commits into
mainfrom
feat/add-dependencies

Conversation

@jackburridge
Copy link
Copy Markdown
Contributor

@jackburridge jackburridge commented Feb 7, 2026

Add dependencies to AsyncFast

from typing import Annotated

from asyncfast import AsyncFast
from asyncfast import Depends
from asyncfast import Header

app = AsyncFast()


async def get_context(
    request_id: Annotated[str, Header(alias="request-id")],
    user_id: Annotated[str, Header(alias="user-id")],
) -> dict[str, str]:
    return {"request_id": request_id, "user_id": user_id}


@app.channel("orders.created")
async def handle_orders(
    context: Annotated[dict[str, str], Depends(get_context)],
) -> None:
    print(context)
  • These are similar to FastAPI dependencies
  • They can yield to handle dependency cleanup
  • They can send messages with MessageSender

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented Feb 7, 2026

Documentation build overview

📚 AMGI | 🛠️ Build #31391175 | 📁 Comparing 2162975 against latest (04c02bf)


🔍 Preview build

Show files changed (1 files in total): 📝 1 modified | ➕ 0 added | ➖ 0 deleted
File Status
specifications/message.html 📝 modified

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 7, 2026

Codecov Report

❌ Patch coverage is 99.90792% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/asyncfast/src/asyncfast/_channel.py 99.62% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jackburridge jackburridge force-pushed the feat/add-dependencies branch from fb0d883 to 66ea69a Compare February 7, 2026 19:39
@jackburridge jackburridge force-pushed the feat/add-dependencies branch 6 times, most recently from c5ea8f5 to 8f1cfad Compare February 8, 2026 16:26
@jackburridge jackburridge force-pushed the feat/add-dependencies branch 2 times, most recently from ace85ba to 9fd69f5 Compare February 12, 2026 18:01
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented Feb 12, 2026

Documentation build overview

📚 AsyncFast | 🛠️ Build #31391176 | 📁 Comparing 2162975 against latest (04c02bf)


🔍 Preview build

Show files changed (1 files in total): 📝 0 modified | ➕ 1 added | ➖ 0 deleted
File Status
dependencies.html ➕ added

@jackburridge jackburridge merged commit 0cce4b3 into main Feb 12, 2026
10 of 11 checks passed
@jackburridge jackburridge deleted the feat/add-dependencies branch February 12, 2026 20:38
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.

1 participant