Skip to main content

BeginTxnGate

Trait BeginTxnGate 

Source
pub trait BeginTxnGate: Send {
    // Required method
    fn ensure_begun<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The lazy begin-the-transaction gate passed to the stream task’s process_once operation under EOS-v2.

The task calls BeginTxnGate::ensure_begun exactly before its first produced record in a commit interval. An interval that fetches no records therefore opens no transaction, which avoids empty-txn churn on an idle app. Under at-least-once the caller passes no gate.

Required Methods§

Source

fn ensure_begun<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Make sure a transaction is open. The first call within the interval begins one, and every later call does nothing. The task calls this method right before the first sink or changelog send.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§