python-cqrs 2.3.0__tar.gz → 2.4.0__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-2.3.0 → python_cqrs-2.4.0}/PKG-INFO +1 -1
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/pyproject.toml +1 -1
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/outbox/repository.py +8 -3
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/outbox/sqlalchemy.py +11 -6
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/python_cqrs.egg-info/PKG-INFO +1 -1
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/LICENSE +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/README.md +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/setup.cfg +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/adapters/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/adapters/amqp.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/adapters/kafka.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/compressors/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/compressors/protocol.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/compressors/zlib.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/container/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/container/di.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/container/protocol.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/deserializers/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/deserializers/json.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/deserializers/protobuf.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/dispatcher/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/dispatcher/dispatcher.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/events/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/events/bootstrap.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/events/event.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/events/event_emitter.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/events/event_handler.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/events/map.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/mediator.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/message_brokers/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/message_brokers/amqp.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/message_brokers/devnull.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/message_brokers/kafka.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/message_brokers/protocol.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/middlewares/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/middlewares/base.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/middlewares/logging.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/outbox/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/outbox/map.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/outbox/mock.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/producer.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/requests/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/requests/bootstrap.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/requests/map.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/requests/request.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/requests/request_handler.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/response.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/serializers/__init__.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/serializers/default.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/cqrs/serializers/protobuf.py +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/python_cqrs.egg-info/SOURCES.txt +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/python_cqrs.egg-info/dependency_links.txt +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/python_cqrs.egg-info/requires.txt +0 -0
- {python_cqrs-2.3.0 → python_cqrs-2.4.0}/src/python_cqrs.egg-info/top_level.txt +0 -0
|
@@ -27,7 +27,6 @@ class OutboxedEventRepository(abc.ABC, typing.Generic[Session]):
|
|
|
27
27
|
@abc.abstractmethod
|
|
28
28
|
def add(
|
|
29
29
|
self,
|
|
30
|
-
session: Session,
|
|
31
30
|
event: ev.NotificationEvent,
|
|
32
31
|
) -> None:
|
|
33
32
|
"""Add an event to the repository."""
|
|
@@ -35,7 +34,6 @@ class OutboxedEventRepository(abc.ABC, typing.Generic[Session]):
|
|
|
35
34
|
@abc.abstractmethod
|
|
36
35
|
async def get_many(
|
|
37
36
|
self,
|
|
38
|
-
session: Session,
|
|
39
37
|
batch_size: int = 100,
|
|
40
38
|
topic: typing.Text | None = None,
|
|
41
39
|
) -> typing.List[OutboxedEvent]:
|
|
@@ -44,8 +42,15 @@ class OutboxedEventRepository(abc.ABC, typing.Generic[Session]):
|
|
|
44
42
|
@abc.abstractmethod
|
|
45
43
|
async def update_status(
|
|
46
44
|
self,
|
|
47
|
-
session: Session,
|
|
48
45
|
outboxed_event_id: int,
|
|
49
46
|
new_status: EventStatus,
|
|
50
47
|
):
|
|
51
48
|
"""Update the event status"""
|
|
49
|
+
|
|
50
|
+
@abc.abstractmethod
|
|
51
|
+
async def commit(self):
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
@abc.abstractmethod
|
|
55
|
+
async def rollback(self):
|
|
56
|
+
pass
|
|
@@ -155,13 +155,14 @@ class SqlAlchemyOutboxedEventRepository(
|
|
|
155
155
|
):
|
|
156
156
|
def __init__(
|
|
157
157
|
self,
|
|
158
|
+
session: sql_session.AsyncSession,
|
|
158
159
|
compressor: compressors.Compressor | None = None,
|
|
159
160
|
):
|
|
161
|
+
self.session = session
|
|
160
162
|
self._compressor = compressor
|
|
161
163
|
|
|
162
164
|
def add(
|
|
163
165
|
self,
|
|
164
|
-
session: sql_session.AsyncSession,
|
|
165
166
|
event: cqrs.NotificationEvent,
|
|
166
167
|
) -> None:
|
|
167
168
|
registered_event = map.OutboxedEventMap.get(event.event_name)
|
|
@@ -177,7 +178,7 @@ class SqlAlchemyOutboxedEventRepository(
|
|
|
177
178
|
if self._compressor is not None:
|
|
178
179
|
bytes_payload = self._compressor.compress(bytes_payload)
|
|
179
180
|
|
|
180
|
-
session.add(
|
|
181
|
+
self.session.add(
|
|
181
182
|
OutboxModel(
|
|
182
183
|
event_id=event.event_id,
|
|
183
184
|
event_id_bin=func.UUID_TO_BIN(event.event_id),
|
|
@@ -208,12 +209,11 @@ class SqlAlchemyOutboxedEventRepository(
|
|
|
208
209
|
|
|
209
210
|
async def get_many(
|
|
210
211
|
self,
|
|
211
|
-
session: sql_session.AsyncSession,
|
|
212
212
|
batch_size: int = 100,
|
|
213
213
|
topic: typing.Text | None = None,
|
|
214
214
|
) -> typing.List[repository.OutboxedEvent]:
|
|
215
215
|
events: typing.Sequence[OutboxModel] = (
|
|
216
|
-
(await session.execute(OutboxModel.get_batch_query(batch_size, topic)))
|
|
216
|
+
(await self.session.execute(OutboxModel.get_batch_query(batch_size, topic)))
|
|
217
217
|
.scalars()
|
|
218
218
|
.all()
|
|
219
219
|
)
|
|
@@ -230,10 +230,15 @@ class SqlAlchemyOutboxedEventRepository(
|
|
|
230
230
|
|
|
231
231
|
async def update_status(
|
|
232
232
|
self,
|
|
233
|
-
session: sql_session.AsyncSession,
|
|
234
233
|
outboxed_event_id: int,
|
|
235
234
|
new_status: repository.EventStatus,
|
|
236
235
|
) -> None:
|
|
237
|
-
await session.execute(
|
|
236
|
+
await self.session.execute(
|
|
238
237
|
statement=OutboxModel.update_status_query(outboxed_event_id, new_status),
|
|
239
238
|
)
|
|
239
|
+
|
|
240
|
+
async def commit(self):
|
|
241
|
+
await self.session.commit()
|
|
242
|
+
|
|
243
|
+
async def rollback(self):
|
|
244
|
+
await self.session.rollback()
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|