Skip to content

DIContextMiddleware for faststream.#193

Merged
xelandernt merged 4 commits into
mainfrom
faststream-context
Jul 23, 2025
Merged

DIContextMiddleware for faststream.#193
xelandernt merged 4 commits into
mainfrom
faststream-context

Conversation

@xelandernt
Copy link
Copy Markdown
Collaborator

Implements a middleware for faststream that initializes the container context during message processing.

@xelandernt xelandernt self-assigned this Jul 22, 2025
@xelandernt xelandernt added enhancement New feature or request v3 Relevant to version 3.* labels Jul 22, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

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

Files with missing lines Coverage Δ
...ests/integrations/faststream/test_faststream_di.py 100.00% <100.00%> (ø)
that_depends/integrations/faststream.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xelandernt xelandernt marked this pull request as ready for review July 22, 2025 10:12
@xelandernt xelandernt requested a review from Copilot July 22, 2025 10:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a DIContextMiddleware for faststream that initializes the container context during message processing. This enables proper handling of context resources in faststream applications.

Key changes:

  • Introduces DIContextMiddleware class that manages container context lifecycle during message processing
  • Adds faststream as an optional dependency
  • Provides documentation and examples for the new integration

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
that_depends/integrations/faststream.py Implements the core DIContextMiddleware class for faststream integration
tests/integrations/faststream/test_faststream_di.py Updates test to use the new middleware and fixes a typo in function name
pyproject.toml Adds faststream as an optional dependency
docs/providers/context-resources.md Minor documentation clarification
docs/integrations/faststream.md Adds comprehensive documentation for the faststream integration

Comment thread that_depends/integrations/faststream.py Outdated
Comment thread that_depends/integrations/faststream.py Outdated
Comment thread that_depends/integrations/faststream.py
@xelandernt xelandernt merged commit a89eaf9 into main Jul 23, 2025
6 checks passed
@xelandernt xelandernt deleted the faststream-context branch August 10, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request v3 Relevant to version 3.*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants