Query Fetcher Port¶
query_fetcher_port
¶
Outbound port for asynchronously fetching query results.
Defines the QueryFetcherPort ABC for dispatching query messages
and returning their results. Supports CQRS-style architectures where
queries are processed independently of commands.
Responsibilities
- Abstract query dispatch from transport details.
Non-Responsibilities
- Define caching or projection logic.
- Guarantee consistency between read and write models.
QueryFetcherPort
¶
Bases: OutboundPort
ABC for dispatching query messages asynchronously.
Delivery semantics are decoupled from this contract.
Example
Source code in src/forging_blocks/application/ports/outbound/query_fetcher_port.py
fetch(query: Query[QueryPayloadType]) -> QueryFetcherResult
abstractmethod
async
¶
Fetch the result of a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
Query[QueryPayloadType]
|
The query instance. |
required |
Returns:
| Type | Description |
|---|---|
QueryFetcherResult
|
Any result returned by the underlying query handler. |