pub struct MarkerWriter { /* private fields */ }Expand description
Dedicated marker writer thread.
Implementations§
Source§impl MarkerWriter
impl MarkerWriter
Sourcepub fn spawn(
backend: Box<dyn MarkerBackend + Send>,
_clock: &'static AtomicTime,
config: MarkerWriterConfig,
) -> Result<Self, EventStoreError>
pub fn spawn( backend: Box<dyn MarkerBackend + Send>, _clock: &'static AtomicTime, config: MarkerWriterConfig, ) -> Result<Self, EventStoreError>
Spawns the marker writer thread and takes ownership of backend.
§Errors
Returns EventStoreError::Backend when the backend has no open run or when the
writer thread cannot be spawned.
Sourcepub fn submit(
&self,
msg: MarkerMsg,
marker_seq: u64,
) -> Result<bool, EventStoreError>
pub fn submit( &self, msg: MarkerMsg, marker_seq: u64, ) -> Result<bool, EventStoreError>
Submits a marker without blocking the caller.
Returns Ok(false) when the bounded channel is full; the dropped marker
sequence is recorded into the next overflow gap.
§Errors
Returns EventStoreError::Closed when the writer is closed, and
EventStoreError::Backend when msg is not a Snapshot or HiFi marker.
§Panics
Panics if the pending overflow range mutex is poisoned.
Sourcepub fn put_dict(&self, entry: StreamDictEntry) -> Result<bool, EventStoreError>
pub fn put_dict(&self, entry: StreamDictEntry) -> Result<bool, EventStoreError>
Submits a stream dictionary entry to the writer.
Dictionary entries are one-time stream metadata, so this path waits for channel capacity instead of dropping and gap-accounting them.
§Errors
Returns EventStoreError::Closed when the writer is closed.
Trait Implementations§
Source§impl Debug for MarkerWriter
impl Debug for MarkerWriter
Source§impl Drop for MarkerWriter
impl Drop for MarkerWriter
Auto Trait Implementations§
impl !Freeze for MarkerWriter
impl !RefUnwindSafe for MarkerWriter
impl !UnwindSafe for MarkerWriter
impl Send for MarkerWriter
impl Sync for MarkerWriter
impl Unpin for MarkerWriter
impl UnsafeUnpin for MarkerWriter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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 more