python-cq 0.24.0__tar.gz → 0.25.1__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_cq-0.24.0 → python_cq-0.25.1}/PKG-INFO +3 -3
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/__init__.py +2 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/related_events.py +1 -1
- python_cq-0.25.1/cq/_core/routing/dispatchers/functions.py +11 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/middlewares/retry.py +3 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/docs/index.md +2 -2
- {python_cq-0.24.0 → python_cq-0.25.1}/pyproject.toml +3 -3
- {python_cq-0.24.0 → python_cq-0.25.1}/.gitignore +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/LICENSE +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/__init__.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/common/__init__.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/common/typing.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/message.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/middleware.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/queuing/__init__.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/queuing/pump.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/queuing/queues/__init__.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/queuing/queues/abc.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/queuing/queues/memory.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/routing/__init__.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/routing/command_pipeline.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/routing/di.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/routing/dispatchers/__init__.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/routing/dispatchers/abc.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/routing/dispatchers/bus.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/routing/dispatchers/lazy.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/routing/dispatchers/pipe.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/routing/handler.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/_core/routing/router.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/exceptions.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/ext/__init__.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/ext/injection.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/middlewares/__init__.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/middlewares/contextlib.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/middlewares/exc.py +0 -0
- {python_cq-0.24.0 → python_cq-0.25.1}/cq/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: python-cq
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.25.1
|
|
4
4
|
Summary: CQRS library for async Python projects.
|
|
5
5
|
Project-URL: Documentation, https://python-cq.remimd.dev
|
|
6
6
|
Project-URL: Repository, https://github.com/100nm/python-cq
|
|
@@ -32,8 +32,8 @@ Description-Content-Type: text/markdown
|
|
|
32
32
|
|
|
33
33
|
# python-cq
|
|
34
34
|
|
|
35
|
-
[](https://pypi.org/project/python-cq)
|
|
36
|
+
[](https://pypistats.org/packages/python-cq)
|
|
37
37
|
|
|
38
38
|
**python-cq** is an async-first Python library for organizing code around CQRS. It separates reads (queries), writes (commands), and notifications (events) into dedicated message buses, and lets you plug in any dependency injection framework behind a small protocol.
|
|
39
39
|
|
|
@@ -16,6 +16,7 @@ from ._core.routing.command_pipeline import ContextCommandPipeline
|
|
|
16
16
|
from ._core.routing.di import DIAdapter
|
|
17
17
|
from ._core.routing.dispatchers.abc import Dispatcher
|
|
18
18
|
from ._core.routing.dispatchers.bus import Bus
|
|
19
|
+
from ._core.routing.dispatchers.functions import dispatch_sequentially
|
|
19
20
|
from ._core.routing.dispatchers.pipe import ContextPipeline, Pipe
|
|
20
21
|
from ._core.routing.router import Router
|
|
21
22
|
|
|
@@ -46,6 +47,7 @@ __all__ = (
|
|
|
46
47
|
"Router",
|
|
47
48
|
"__router__",
|
|
48
49
|
"command_handler",
|
|
50
|
+
"dispatch_sequentially",
|
|
49
51
|
"event_handler",
|
|
50
52
|
"new_command_bus",
|
|
51
53
|
"new_event_bus",
|
|
@@ -25,7 +25,7 @@ class AnyIORelatedEvents(RelatedEvents):
|
|
|
25
25
|
task_group: TaskGroup = field(default_factory=create_task_group)
|
|
26
26
|
history: list[Event] = field(default_factory=list, init=False)
|
|
27
27
|
|
|
28
|
-
def __bool__(self) -> bool:
|
|
28
|
+
def __bool__(self) -> bool:
|
|
29
29
|
return bool(self.history)
|
|
30
30
|
|
|
31
31
|
async def __aenter__(self) -> Self:
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from cq._core.routing.dispatchers.abc import Dispatcher
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
async def dispatch_sequentially[T, *Ts](
|
|
7
|
+
dispatcher: Dispatcher[T, Any],
|
|
8
|
+
/,
|
|
9
|
+
*messages: T,
|
|
10
|
+
) -> tuple[*Ts]:
|
|
11
|
+
return tuple([await dispatcher.dispatch(message) for message in messages])
|
|
@@ -21,6 +21,9 @@ class RetryMiddleware:
|
|
|
21
21
|
delay: float = 0,
|
|
22
22
|
exceptions: Sequence[type[BaseException]] = (Exception,),
|
|
23
23
|
) -> None:
|
|
24
|
+
if retry < 1:
|
|
25
|
+
raise ValueError(f"`retry` must be at least 1, got {retry}.")
|
|
26
|
+
|
|
24
27
|
self.__delay = delay
|
|
25
28
|
self.__exceptions = tuple(exceptions)
|
|
26
29
|
self.__retry = retry
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# python-cq
|
|
2
2
|
|
|
3
|
-
[](https://pypi.org/project/python-cq)
|
|
4
|
+
[](https://pypistats.org/packages/python-cq)
|
|
5
5
|
|
|
6
6
|
**python-cq** is an async-first Python library for organizing code around CQRS. It separates reads (queries), writes (commands), and notifications (events) into dedicated message buses, and lets you plug in any dependency injection framework behind a small protocol.
|
|
7
7
|
|
|
@@ -9,8 +9,8 @@ dev = [
|
|
|
9
9
|
"ruff",
|
|
10
10
|
]
|
|
11
11
|
docs = [
|
|
12
|
-
"
|
|
13
|
-
"
|
|
12
|
+
"ghp-import",
|
|
13
|
+
"zensical",
|
|
14
14
|
]
|
|
15
15
|
test = [
|
|
16
16
|
"pytest",
|
|
@@ -20,7 +20,7 @@ test = [
|
|
|
20
20
|
|
|
21
21
|
[project]
|
|
22
22
|
name = "python-cq"
|
|
23
|
-
version = "0.
|
|
23
|
+
version = "0.25.1"
|
|
24
24
|
description = "CQRS library for async Python projects."
|
|
25
25
|
license = "MIT"
|
|
26
26
|
license-files = ["LICENSE"]
|
|
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
|