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,

source

pub fn new( commit_log: CL, marshaller: M, consumer_group_name: &str, topic: Topic ) -> Self

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,

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,

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,

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,

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,

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V