pub struct CommitLogTopicAdapter<CL, E, M>where
CL: CommitLog,
M: CommitLogMarshaller<E>,
for<'async_trait> E: DeserializeOwned + Serialize + Send + Sync + 'async_trait,{ /* private fields */ }
Expand description
Adapts a Streambed CommitLog for use with Akka Persistence. This adapter retains an instance of a CommitLog and is associated with a specific topic. A topic maps one-to-one with a entity type i.e. many entity instances are held within one topic.
As CommitLog is intended for use at the edge, we assume that all entities will be event sourced into memory.
Developers are required to provide implementations of SourceProvider for bytes and events i.e. deserialization/decryption and serialization/encryption respectively, along with CommitLog’s use of keys for compaction including the storage of entities.
Implementations§
source§impl<CL, E, M> CommitLogTopicAdapter<CL, E, M>where
CL: CommitLog,
M: CommitLogMarshaller<E>,
for<'async_trait> E: DeserializeOwned + Serialize + Send + Sync + 'async_trait,
impl<CL, E, M> CommitLogTopicAdapter<CL, E, M>where CL: CommitLog, M: CommitLogMarshaller<E>, for<'async_trait> E: DeserializeOwned + Serialize + Send + Sync + 'async_trait,
Trait Implementations§
source§impl<CL, E, M> Handler<E> for CommitLogTopicAdapter<CL, E, M>where
CL: CommitLog,
M: CommitLogMarshaller<E> + Send + Sync,
for<'async_trait> E: DeserializeOwned + Serialize + Send + Sync + 'async_trait,
impl<CL, E, M> Handler<E> for CommitLogTopicAdapter<CL, E, M>where CL: CommitLog, M: CommitLogMarshaller<E> + Send + Sync, for<'async_trait> E: DeserializeOwned + Serialize + Send + Sync + 'async_trait,
source§fn process<'life0, 'async_trait>(
&'life0 mut self,
envelope: EntityManagerEventEnvelope<E>
) -> Pin<Box<dyn Future<Output = Result<EntityManagerEventEnvelope<E>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn process<'life0, 'async_trait>( &'life0 mut self, envelope: EntityManagerEventEnvelope<E> ) -> Pin<Box<dyn Future<Output = Result<EntityManagerEventEnvelope<E>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Consume an envelope, performing some processing
e.g. persisting an envelope, and then returning the same envelope
if all went well.
source§impl<CL, E, M> SourceProvider<E> for CommitLogTopicAdapter<CL, E, M>where
CL: CommitLog,
M: CommitLogMarshaller<E> + Send + Sync,
for<'async_trait> E: DeserializeOwned + Serialize + Send + Sync + 'async_trait,
impl<CL, E, M> SourceProvider<E> for CommitLogTopicAdapter<CL, E, M>where CL: CommitLog, M: CommitLogMarshaller<E> + Send + Sync, for<'async_trait> E: DeserializeOwned + Serialize + Send + Sync + 'async_trait,
source§fn source_initial<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = EntityManagerEventEnvelope<E>> + Send + 'async_trait>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn source_initial<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = EntityManagerEventEnvelope<E>> + Send + 'async_trait>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Produce an initial source of events, which is called upon an entity
manager task starting up. Any error from this method is considered fatal
and will terminate the entity manager.
source§fn source<'life0, 'life1, 'async_trait>(
&'life0 mut self,
entity_id: &'life1 EntityId
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = EntityManagerEventEnvelope<E>> + Send + 'async_trait>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn source<'life0, 'life1, 'async_trait>( &'life0 mut self, entity_id: &'life1 EntityId ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = EntityManagerEventEnvelope<E>> + Send + 'async_trait>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Produce a source of events. An entity id
is passed to the source method so that the source is
discriminate regarding the entity events to supply.
Auto Trait Implementations§
impl<CL, E, M> RefUnwindSafe for CommitLogTopicAdapter<CL, E, M>where CL: RefUnwindSafe, E: RefUnwindSafe, M: RefUnwindSafe,
impl<CL, E, M> Send for CommitLogTopicAdapter<CL, E, M>where M: Send,
impl<CL, E, M> Sync for CommitLogTopicAdapter<CL, E, M>where M: Sync,
impl<CL, E, M> Unpin for CommitLogTopicAdapter<CL, E, M>where CL: Unpin, E: Unpin, M: Unpin,
impl<CL, E, M> UnwindSafe for CommitLogTopicAdapter<CL, E, M>where CL: UnwindSafe, E: UnwindSafe, M: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more