1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
use async_trait::async_trait; use crate::header::PrimaryKey; #[allow(unused_imports)] use crate::meta::*; use super::error::*; use super::transaction::*; use std::sync::Arc; #[async_trait] pub(crate) trait EventPipe: Send + Sync { async fn feed(&self, mut trans: Transaction) -> Result<(), CommitError>; async fn try_lock(&self, key: PrimaryKey) -> Result<bool, CommitError>; async fn unlock(&self, key: PrimaryKey) -> Result<(), CommitError>; fn set_next(&self, next: Arc<dyn EventPipe>); }