pub struct InMemorySessionLog { /* private fields */ }Expand description
In-process SessionLog for single-binary deployments and tests.
Backed by a per-ThreadKey Vec<GraphEvent>. Production
multi-pod deployments use the Postgres or Redis impls in
entelix-persistence.
Implementations§
Trait Implementations§
Source§impl Default for InMemorySessionLog
impl Default for InMemorySessionLog
Source§fn default() -> InMemorySessionLog
fn default() -> InMemorySessionLog
Returns the “default value” for a type. Read more
Source§impl SessionLog for InMemorySessionLog
impl SessionLog for InMemorySessionLog
Source§fn append<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
events: &'life2 [GraphEvent],
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn append<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
events: &'life2 [GraphEvent],
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Append
events for key. Returns the highest ordinal
assigned (1-based, so an empty log becomes ordinal 1 after
appending the first event).Source§fn load_since<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
cursor: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<GraphEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_since<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
cursor: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<GraphEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load every event with ordinal
> cursor. Pass 0 for “from
the beginning”. Returns events in ordinal-ascending order.Source§fn archive_before<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
watermark: u64,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn archive_before<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 ThreadKey,
watermark: u64,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Advance the archival watermark to
watermark. Events with
ordinal <= watermark may be moved to cold storage at the
implementation’s discretion. Returns the number of events
archived. The watermark is monotonic per key; calls with
a value <= the current watermark are no-ops.Auto Trait Implementations§
impl !Freeze for InMemorySessionLog
impl !RefUnwindSafe for InMemorySessionLog
impl Send for InMemorySessionLog
impl Sync for InMemorySessionLog
impl Unpin for InMemorySessionLog
impl UnsafeUnpin for InMemorySessionLog
impl UnwindSafe for InMemorySessionLog
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