python-cqrs 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_cqrs-0.1.0/src/python_cqrs.egg-info → python_cqrs-0.1.2}/PKG-INFO +1 -1
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/pyproject.toml +1 -1
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/dispatcher/dispatcher.py +4 -4
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/mediator.py +2 -2
- {python_cqrs-0.1.0 → python_cqrs-0.1.2/src/python_cqrs.egg-info}/PKG-INFO +1 -1
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/LICENSE +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/README.md +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/setup.cfg +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/__init__.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/adapters/__init__.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/adapters/amqp.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/adapters/kafka.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/compressors/__init__.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/compressors/protocol.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/compressors/zlib.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/container/__init__.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/container/di.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/container/protocol.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/dispatcher/__init__.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/events/__init__.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/events/bootstrap.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/events/event.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/events/event_emitter.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/events/event_handler.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/events/map.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/message_brokers/__init__.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/message_brokers/amqp.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/message_brokers/devnull.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/message_brokers/kafka.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/message_brokers/protocol.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/middlewares/__init__.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/middlewares/base.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/middlewares/logging.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/outbox/__init__.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/outbox/producer.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/outbox/protocol.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/outbox/repository.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/outbox/sqlalchemy.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/requests/__init__.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/requests/bootstrap.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/requests/map.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/requests/request.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/requests/request_handler.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/cqrs/response.py +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/python_cqrs.egg-info/SOURCES.txt +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/python_cqrs.egg-info/dependency_links.txt +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/python_cqrs.egg-info/requires.txt +0 -0
- {python_cqrs-0.1.0 → python_cqrs-0.1.2}/src/python_cqrs.egg-info/top_level.txt +0 -0
|
@@ -17,7 +17,7 @@ from cqrs.requests import request_handler
|
|
|
17
17
|
|
|
18
18
|
logger = logging.getLogger("cqrs")
|
|
19
19
|
|
|
20
|
-
_Resp = typing.TypeVar("_Resp", resp.Response, None,
|
|
20
|
+
_Resp = typing.TypeVar("_Resp", resp.Response, None, contravariant=True)
|
|
21
21
|
|
|
22
22
|
_RequestHandler: typing.TypeAlias = (
|
|
23
23
|
request_handler.RequestHandler | request_handler.SyncRequestHandler
|
|
@@ -30,8 +30,8 @@ _EventHandler: typing.TypeAlias = (
|
|
|
30
30
|
class RequestHandlerDoesNotExist(Exception): ...
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
class RequestDispatchResult(pydantic.BaseModel):
|
|
34
|
-
response:
|
|
33
|
+
class RequestDispatchResult(pydantic.BaseModel, typing.Generic[_Resp]):
|
|
34
|
+
response: _Resp = pydantic.Field(default=None)
|
|
35
35
|
events: typing.List[cqrs_events.Event] = pydantic.Field(default_factory=list)
|
|
36
36
|
|
|
37
37
|
|
|
@@ -59,7 +59,7 @@ class RequestDispatcher:
|
|
|
59
59
|
wrapped_handle = self._middleware_chain.wrap(
|
|
60
60
|
functools.partial(asyncio.to_thread, handler.handle),
|
|
61
61
|
)
|
|
62
|
-
response
|
|
62
|
+
response = await wrapped_handle(request)
|
|
63
63
|
|
|
64
64
|
return RequestDispatchResult(response=response, events=handler.events)
|
|
65
65
|
|
|
@@ -9,7 +9,7 @@ from cqrs import (
|
|
|
9
9
|
response,
|
|
10
10
|
)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
_Resp = typing.TypeVar("_Resp", response.Response, None, contravariant=True)
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class RequestMediator:
|
|
@@ -58,7 +58,7 @@ class RequestMediator:
|
|
|
58
58
|
middleware_chain=middleware_chain, # type: ignore
|
|
59
59
|
)
|
|
60
60
|
|
|
61
|
-
async def send(self, request: requests.Request) ->
|
|
61
|
+
async def send(self, request: requests.Request) -> _Resp:
|
|
62
62
|
dispatch_result = await self._dispatcher.dispatch(request)
|
|
63
63
|
|
|
64
64
|
if dispatch_result.events:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|