eventsourcing 9.3.4__py3-none-any.whl → 9.3.5__py3-none-any.whl
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.
Potentially problematic release.
This version of eventsourcing might be problematic. Click here for more details.
- eventsourcing/application.py +0 -15
- eventsourcing/system.py +25 -2
- {eventsourcing-9.3.4.dist-info → eventsourcing-9.3.5.dist-info}/METADATA +1 -1
- {eventsourcing-9.3.4.dist-info → eventsourcing-9.3.5.dist-info}/RECORD +7 -7
- {eventsourcing-9.3.4.dist-info → eventsourcing-9.3.5.dist-info}/AUTHORS +0 -0
- {eventsourcing-9.3.4.dist-info → eventsourcing-9.3.5.dist-info}/LICENSE +0 -0
- {eventsourcing-9.3.4.dist-info → eventsourcing-9.3.5.dist-info}/WHEEL +0 -0
eventsourcing/application.py
CHANGED
|
@@ -599,18 +599,6 @@ class ProcessingEvent:
|
|
|
599
599
|
self.collect_events(*aggregates, **kwargs)
|
|
600
600
|
|
|
601
601
|
|
|
602
|
-
class RecordingEvent:
|
|
603
|
-
def __init__(
|
|
604
|
-
self,
|
|
605
|
-
application_name: str,
|
|
606
|
-
recordings: List[Recording],
|
|
607
|
-
previous_max_notification_id: int | None,
|
|
608
|
-
):
|
|
609
|
-
self.application_name = application_name
|
|
610
|
-
self.recordings = recordings
|
|
611
|
-
self.previous_max_notification_id = previous_max_notification_id
|
|
612
|
-
|
|
613
|
-
|
|
614
602
|
class Application:
|
|
615
603
|
"""
|
|
616
604
|
Base class for event-sourced applications.
|
|
@@ -659,9 +647,6 @@ class Application:
|
|
|
659
647
|
self._repository = self.construct_repository()
|
|
660
648
|
self._notification_log = self.construct_notification_log()
|
|
661
649
|
self.closing = Event()
|
|
662
|
-
self.previous_max_notification_id: int | None = (
|
|
663
|
-
self.recorder.max_notification_id()
|
|
664
|
-
)
|
|
665
650
|
|
|
666
651
|
@property
|
|
667
652
|
def repository(self) -> Repository:
|
eventsourcing/system.py
CHANGED
|
@@ -30,11 +30,10 @@ from eventsourcing.application import (
|
|
|
30
30
|
Application,
|
|
31
31
|
NotificationLog,
|
|
32
32
|
ProcessingEvent,
|
|
33
|
-
RecordingEvent,
|
|
34
33
|
Section,
|
|
35
34
|
TApplication,
|
|
36
35
|
)
|
|
37
|
-
from eventsourcing.domain import DomainEventProtocol
|
|
36
|
+
from eventsourcing.domain import DomainEventProtocol, MutableOrImmutableAggregate
|
|
38
37
|
from eventsourcing.persistence import (
|
|
39
38
|
IntegrityError,
|
|
40
39
|
Mapper,
|
|
@@ -46,6 +45,20 @@ from eventsourcing.persistence import (
|
|
|
46
45
|
from eventsourcing.utils import EnvType, get_topic, resolve_topic
|
|
47
46
|
|
|
48
47
|
ProcessingJob = Tuple[DomainEventProtocol, Tracking]
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class RecordingEvent:
|
|
51
|
+
def __init__(
|
|
52
|
+
self,
|
|
53
|
+
application_name: str,
|
|
54
|
+
recordings: List[Recording],
|
|
55
|
+
previous_max_notification_id: int | None,
|
|
56
|
+
):
|
|
57
|
+
self.application_name = application_name
|
|
58
|
+
self.recordings = recordings
|
|
59
|
+
self.previous_max_notification_id = previous_max_notification_id
|
|
60
|
+
|
|
61
|
+
|
|
49
62
|
ConvertingJob = Optional[Union[RecordingEvent, List[Notification]]]
|
|
50
63
|
|
|
51
64
|
|
|
@@ -230,6 +243,7 @@ class Leader(Application):
|
|
|
230
243
|
|
|
231
244
|
def __init__(self, env: EnvType | None = None) -> None:
|
|
232
245
|
super().__init__(env)
|
|
246
|
+
self.previous_max_notification_id: int | None = None
|
|
233
247
|
self.followers: List[RecordingEventReceiver] = []
|
|
234
248
|
|
|
235
249
|
def lead(self, follower: RecordingEventReceiver) -> None:
|
|
@@ -238,6 +252,15 @@ class Leader(Application):
|
|
|
238
252
|
"""
|
|
239
253
|
self.followers.append(follower)
|
|
240
254
|
|
|
255
|
+
def save(
|
|
256
|
+
self,
|
|
257
|
+
*objs: MutableOrImmutableAggregate | DomainEventProtocol | None,
|
|
258
|
+
**kwargs: Any,
|
|
259
|
+
) -> List[Recording]:
|
|
260
|
+
if self.previous_max_notification_id is None:
|
|
261
|
+
self.previous_max_notification_id = self.recorder.max_notification_id()
|
|
262
|
+
return super().save(*objs, **kwargs)
|
|
263
|
+
|
|
241
264
|
def _notify(self, recordings: List[Recording]) -> None:
|
|
242
265
|
"""
|
|
243
266
|
Calls :func:`receive_recording_event` on each follower
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
eventsourcing/__init__.py,sha256=st2H3shrhTk5rqoUeZHUW8XD9iOX9tGGtQFWr2HGYmo,26
|
|
2
|
-
eventsourcing/application.py,sha256=
|
|
2
|
+
eventsourcing/application.py,sha256=AwTpzqByZT4b6tS6HIFQkH3m9Xx2tchBN-j7jAq63wc,35868
|
|
3
3
|
eventsourcing/cipher.py,sha256=NJcVfZdSlCER6xryM4zVoY3cmKstF-iSSniB4jmpaKg,3200
|
|
4
4
|
eventsourcing/compressor.py,sha256=IdvrJUB9B2td871oifInv4lGXmHwYL9d69MbHHCr7uI,421
|
|
5
5
|
eventsourcing/dispatch.py,sha256=yYSpT-jqc6l_wTdqEnfPJJfvsZN2Ta8g2anrVPWIcqQ,1412
|
|
@@ -10,15 +10,15 @@ eventsourcing/popo.py,sha256=AApSGneHuXa8yHOWdDfsFTMVDI-9ivEpuKTX1BSOXr8,6547
|
|
|
10
10
|
eventsourcing/postgres.py,sha256=NatfdA-YQQPB1qWsQg23Uhyy6R-hcGNOJHJ1bKmFuKQ,29772
|
|
11
11
|
eventsourcing/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
eventsourcing/sqlite.py,sha256=jz7SZk26Gcsjw88KL1xnr4-1tStTW16f1NR6TjMsZnQ,18466
|
|
13
|
-
eventsourcing/system.py,sha256=
|
|
13
|
+
eventsourcing/system.py,sha256=tRn-KpSxcrpJ3x8BtpD9hxYSvk8IHBIPSfTMKPLVT60,46307
|
|
14
14
|
eventsourcing/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
eventsourcing/tests/application.py,sha256=wBanhWzAZvL3fYxCFe5cloN-Up7uLw6KcdRQ2dhKVAg,17586
|
|
16
16
|
eventsourcing/tests/domain.py,sha256=lHSlY6jIoSeqlcPSbrrozEPUJGvJ8bgPrznlmzTxn2w,3254
|
|
17
17
|
eventsourcing/tests/persistence.py,sha256=giLWEZDdViXY8_SHCJerJ0sYVbJUP3UkLKaEbel9sqs,45777
|
|
18
18
|
eventsourcing/tests/postgres_utils.py,sha256=xymcGYasUXeZTBenkHz-ykD8HtrFjVM1Z7-qRrH6OQk,1364
|
|
19
19
|
eventsourcing/utils.py,sha256=PIWDvoGiKCXsNbR5DirkoJ_svopg80SoH37bqxOcjkU,8247
|
|
20
|
-
eventsourcing-9.3.
|
|
21
|
-
eventsourcing-9.3.
|
|
22
|
-
eventsourcing-9.3.
|
|
23
|
-
eventsourcing-9.3.
|
|
24
|
-
eventsourcing-9.3.
|
|
20
|
+
eventsourcing-9.3.5.dist-info/AUTHORS,sha256=8aHOM4UbNZcKlD-cHpFRcM6RWyCqtwtxRev6DeUgVRs,137
|
|
21
|
+
eventsourcing-9.3.5.dist-info/LICENSE,sha256=bSE_F-T6cQPmMY5LuJC27km_pGB1XCVuUFx1uY0Nueg,1512
|
|
22
|
+
eventsourcing-9.3.5.dist-info/METADATA,sha256=yLNXm5rtENkOWB7kK63T2ohN1w7FuraebWFlk-Nxfho,9734
|
|
23
|
+
eventsourcing-9.3.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
24
|
+
eventsourcing-9.3.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|