python-hexagonal 0.3.0__tar.gz → 0.3.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_hexagonal-0.3.0 → python_hexagonal-0.3.1}/PKG-INFO +1 -1
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/pyproject.toml +1 -1
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/base/message_bus.py +30 -16
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/domain/queries.py +2 -2
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/README.md +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/base/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/base/command_bus.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/base/event_bus.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/base/infrastructure.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/base/query.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/base/utils.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/inmemory/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/inmemory/command_bus.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/inmemory/event_bus.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/inmemory/infra.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/mappers.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/base/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/base/repository.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/base/unit_of_work.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlalchemy/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlalchemy/datastore.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlalchemy/env_vars.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlalchemy/infrastructure.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlalchemy/models.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlalchemy/outbox.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlalchemy/repository.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlalchemy/unit_of_work.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlite/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlite/datastore.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlite/env_vars.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlite/infrastructure.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlite/outbox.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlite/repository.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/repository/sqlite/unit_of_work.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivers/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivers/app.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/application/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/application/api.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/application/app.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/application/bus_app.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/application/handlers.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/application/infrastructure.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/application/query.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/application/topics.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/domain/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/domain/aggregate.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/domain/base.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/domain/exceptions.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/domain/responses.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/entrypoints/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/entrypoints/app.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/entrypoints/base.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/entrypoints/bus.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/entrypoints/sqlalchemy.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/entrypoints/sqlite.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/integrations/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/integrations/sqlalchemy.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/drivens/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/drivens/application.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/drivens/buses.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/drivens/infrastructure.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/drivens/repository.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/drivens/scoped.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/drivers/__init__.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/drivers/app.py +0 -0
- {python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/py.typed +0 -0
|
@@ -46,33 +46,47 @@ class MessageBus(IBaseMessageBus[TManager], Infrastructure):
|
|
|
46
46
|
|
|
47
47
|
def save_to_outbox(self, *messages: CloudMessage[Any]) -> None:
|
|
48
48
|
self.verify()
|
|
49
|
+
self._run_with_outbox_repository(
|
|
50
|
+
lambda outbox_repository: outbox_repository.save(*messages)
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
# publish
|
|
54
|
+
def publish_from_outbox(self, limit: int | None = None) -> None:
|
|
55
|
+
self.verify()
|
|
56
|
+
self._run_with_outbox_repository(
|
|
57
|
+
lambda outbox_repository: self._publish_messages(
|
|
58
|
+
outbox_repository,
|
|
59
|
+
*outbox_repository.fetch_pending(limit=limit),
|
|
60
|
+
)
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
def _run_with_outbox_repository(
|
|
64
|
+
self,
|
|
65
|
+
work: Callable[[IOutboxRepository[TManager]], Any],
|
|
66
|
+
) -> Any:
|
|
49
67
|
if self._write_scope_runner is None or self._outbox_repository_getter is None:
|
|
50
|
-
self.outbox_repository
|
|
51
|
-
return
|
|
52
|
-
outbox_repository_getter = self._outbox_repository_getter
|
|
68
|
+
return work(self.outbox_repository)
|
|
53
69
|
|
|
70
|
+
outbox_repository_getter = self._outbox_repository_getter
|
|
54
71
|
scope = self._write_scope_runner.current_write_scope
|
|
55
72
|
if scope is not None:
|
|
56
|
-
outbox_repository_getter(scope)
|
|
57
|
-
return
|
|
73
|
+
return work(outbox_repository_getter(scope))
|
|
58
74
|
|
|
59
|
-
self._write_scope_runner.run_in_write_scope(
|
|
60
|
-
lambda write_scope: outbox_repository_getter(write_scope)
|
|
75
|
+
return self._write_scope_runner.run_in_write_scope(
|
|
76
|
+
lambda write_scope: work(outbox_repository_getter(write_scope))
|
|
61
77
|
)
|
|
62
78
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
messages
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def _publish_messages(self, *messages: CloudMessage[Any]) -> None:
|
|
79
|
+
def _publish_messages(
|
|
80
|
+
self,
|
|
81
|
+
outbox_repository: IOutboxRepository[TManager],
|
|
82
|
+
*messages: CloudMessage[Any],
|
|
83
|
+
) -> None:
|
|
70
84
|
for message in messages:
|
|
71
85
|
try:
|
|
72
86
|
self._publish_message(message)
|
|
73
|
-
|
|
87
|
+
outbox_repository.mark_as_published(message.message_id)
|
|
74
88
|
except Exception as e:
|
|
75
|
-
|
|
89
|
+
outbox_repository.mark_as_failed(message.message_id, error=str(e))
|
|
76
90
|
|
|
77
91
|
@abstractmethod
|
|
78
92
|
def _publish_message(self, message: CloudMessage[Any]) -> None: ...
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any, Generic, Type
|
|
1
|
+
from typing import Any, Generic, Type
|
|
2
2
|
|
|
3
3
|
from .aggregate import TAggregateOrEntity, TIdEntity
|
|
4
4
|
from .base import QueryOne, ValueObject
|
|
@@ -18,5 +18,5 @@ class GetById(
|
|
|
18
18
|
) -> "GetById[TAggregateOrEntity, TIdEntity]":
|
|
19
19
|
return cls(
|
|
20
20
|
id=id,
|
|
21
|
-
view=
|
|
21
|
+
view=AggregateView[agg_type], # type: ignore
|
|
22
22
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/__init__.py
RENAMED
|
File without changes
|
{python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/base/query.py
RENAMED
|
File without changes
|
{python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivens/buses/base/utils.py
RENAMED
|
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
|
{python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/adapters/drivers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/application/infrastructure.py
RENAMED
|
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
|
{python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/drivens/application.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_hexagonal-0.3.0 → python_hexagonal-0.3.1}/src/hexagonal/ports/drivens/infrastructure.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|