pub struct TransactionalProcessor { /* private fields */ }Expand description
Transactional processing manager
Implementations§
Source§impl TransactionalProcessor
impl TransactionalProcessor
Sourcepub fn new(config: TransactionalConfig) -> Self
pub fn new(config: TransactionalConfig) -> Self
Create a new transactional processor
Sourcepub async fn begin_transaction(
&self,
isolation_level: Option<IsolationLevel>,
) -> Result<String>
pub async fn begin_transaction( &self, isolation_level: Option<IsolationLevel>, ) -> Result<String>
Begin a new transaction
Sourcepub async fn add_events(
&self,
transaction_id: &str,
events: Vec<StreamEvent>,
) -> Result<()>
pub async fn add_events( &self, transaction_id: &str, events: Vec<StreamEvent>, ) -> Result<()>
Add events to a transaction
Sourcepub async fn prepare_transaction(&self, transaction_id: &str) -> Result<bool>
pub async fn prepare_transaction(&self, transaction_id: &str) -> Result<bool>
Prepare transaction (first phase of two-phase commit)
Sourcepub async fn commit_transaction(&self, transaction_id: &str) -> Result<()>
pub async fn commit_transaction(&self, transaction_id: &str) -> Result<()>
Commit transaction (second phase of two-phase commit)
Sourcepub async fn abort_transaction(&self, transaction_id: &str) -> Result<()>
pub async fn abort_transaction(&self, transaction_id: &str) -> Result<()>
Abort transaction
Sourcepub fn is_event_processed(&self, event: &StreamEvent) -> bool
pub fn is_event_processed(&self, event: &StreamEvent) -> bool
Check if an event has been processed (idempotency check)
Sourcepub fn mark_event_processed(&self, event: &StreamEvent)
pub fn mark_event_processed(&self, event: &StreamEvent)
Mark an event as processed
Sourcepub async fn create_checkpoint(&self) -> Result<String>
pub async fn create_checkpoint(&self) -> Result<String>
Create a checkpoint
Sourcepub fn get_transaction_status(
&self,
transaction_id: &str,
) -> Option<TransactionState>
pub fn get_transaction_status( &self, transaction_id: &str, ) -> Option<TransactionState>
Get transaction status
Sourcepub fn get_stats(&self) -> TransactionalStats
pub fn get_stats(&self) -> TransactionalStats
Get statistics
Sourcepub async fn recover_from_checkpoint(&self, checkpoint_id: &str) -> Result<()>
pub async fn recover_from_checkpoint(&self, checkpoint_id: &str) -> Result<()>
Recover from checkpoint
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TransactionalProcessor
impl !RefUnwindSafe for TransactionalProcessor
impl Send for TransactionalProcessor
impl Sync for TransactionalProcessor
impl Unpin for TransactionalProcessor
impl UnsafeUnpin for TransactionalProcessor
impl !UnwindSafe for TransactionalProcessor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.