Esempio n. 1
0
 def __init__(self):
     self.event_store = EventStore(
         record_manager=CassandraRecordManager(
             record_class=StoredEventRecord,
             sequenced_item_class=StoredEvent),
         event_mapper=SequencedItemMapper(sequenced_item_class=StoredEvent,
                                          other_attr_names=()),
     )
     self.repository = ExampleRepository(event_store=self.event_store)
     self.persistence_policy = PersistencePolicy(
         event_store=self.event_store, persist_event_type=DomainEvent)
Esempio n. 2
0
 def __init__(self):
     self.event_store = EventStore(
         record_manager=CassandraRecordManager(
             record_class=TimeuuidSequencedRecord,
             sequenced_item_class=SequencedItem),
         event_mapper=SequencedItemMapper(
             sequenced_item_class=SequencedItem,
             sequence_id_attr_name="originator_id",
             position_attr_name="event_id",
         ),
     )
     self.repository = EventSourcedRepository(event_store=self.event_store)
     self.persistence_policy = PersistencePolicy(
         event_store=self.event_store, persist_event_type=DomainEvent)
 def __init__(self):
     self.event_store = EventStore(
         record_manager=CassandraRecordManager(
             record_class=TimeuuidSequencedRecord,
             sequenced_item_class=SequencedItem,
         ),
         sequenced_item_mapper=SequencedItemMapper(
             sequenced_item_class=SequencedItem,
             sequence_id_attr_name='originator_id',
             position_attr_name='event_id',
         )
     )
     self.repository = EventSourcedRepository(
         event_store=self.event_store,
     )
     self.persistence_policy = PersistencePolicy(self.event_store)