pub struct JsonlJournal { /* private fields */ }Expand description
One JSON-lines file per run, fsynced on every append.
Sequence checks are enforced within this process; use a database-backed journal when several processes may resume the same run.
Implementations§
Trait Implementations§
Source§impl Journal for JsonlJournal
impl Journal for JsonlJournal
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<(), JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn acquire_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<Result<(), LeaseHolder>, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn acquire_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<Result<(), LeaseHolder>, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Take (or re-take) the lease on
run_id for ttl. Returns the current
holder if another live owner has it.Source§fn renew_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<bool, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn renew_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<bool, JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Extend a lease this owner holds.
false means it was lost.fn release_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
owner: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), JournalError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl !Freeze for JsonlJournal
impl !RefUnwindSafe for JsonlJournal
impl !UnwindSafe for JsonlJournal
impl Send for JsonlJournal
impl Sync for JsonlJournal
impl Unpin for JsonlJournal
impl UnsafeUnpin for JsonlJournal
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