Skip to content

feat: ✨ Introduce DeferredBus - #48

Merged
remimd merged 1 commit into
devfrom
defer
Oct 10, 2025
Merged

feat: ✨ Introduce DeferredBus#48
remimd merged 1 commit into
devfrom
defer

Conversation

@remimd

@remimd remimd commented Oct 10, 2025

Copy link
Copy Markdown
Member

No description provided.

@remimd
remimd requested a review from Copilot October 10, 2025 15:33
@remimd remimd self-assigned this Oct 10, 2025

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces a new DeferredBus abstraction that enables deferred execution of commands, queries, and events in FastAPI applications. The implementation leverages FastAPI's BackgroundTasks to execute operations asynchronously without blocking the response.

  • Adds a new DeferredBus protocol for deferred execution
  • Implements FastAPI-specific deferred bus variants for commands, events, and queries
  • Provides dependency injection integration through annotated types

Reviewed Changes

Copilot reviewed 7 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cq/_core/defer.py Defines the core DeferredBus protocol with abstract defer method
cq/init.py Exports the new DeferredBus class in the public API
cq/ext/fastapi.py Implements FastAPI-specific deferred buses using BackgroundTasks
cq/ext/fastapi.pyi Provides type aliases for the three deferred bus variants
tests/ext/test_fastapi.py Adds comprehensive test coverage for the FastAPI deferred bus functionality
pyproject.toml Adds FastAPI and httpx as test dependencies
documentation/fastapi-example.md Updates documentation with usage example for the new deferred bus

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread cq/ext/fastapi.py
Comment thread cq/ext/fastapi.py
@remimd
remimd merged commit 1ff4111 into dev Oct 10, 2025
6 checks passed
@remimd
remimd deleted the defer branch October 10, 2025 15:36
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