pub struct ManagedEventProvider<F>where
F: ChainDataSourceFactory,{ /* private fields */ }Expand description
Maintains one in-memory source engine per durable session while SQLite remains authoritative across process restarts.
Implementations§
Source§impl<F> ManagedEventProvider<F>where
F: ChainDataSourceFactory,
impl<F> ManagedEventProvider<F>where
F: ChainDataSourceFactory,
Sourcepub fn new(factory: F, reorg_depth: usize) -> Self
pub fn new(factory: F, reorg_depth: usize) -> Self
Create a provider retaining reorg_depth canonical blocks per session.
§Panics
Panics when reorg_depth is zero. Configuration-facing callers should
prefer Self::try_new to report that invalid boundary without panic.
Sourcepub fn try_new(factory: F, reorg_depth: usize) -> Result<Self, SourceError>
pub fn try_new(factory: F, reorg_depth: usize) -> Result<Self, SourceError>
Fallibly create a provider with a nonzero retained canonical history.
§Errors
Returns SourceError::InvalidReorgDepth when reorg_depth is zero.
Sourcepub fn with_request_timeout(
self,
request_timeout: Duration,
) -> Result<Self, SourceError>
pub fn with_request_timeout( self, request_timeout: Duration, ) -> Result<Self, SourceError>
Bound each provider height/query operation, including its internal retries.
§Errors
Returns SourceError::InvalidRequestTimeout when the timeout is zero.
Sourcepub fn with_max_delivery_bytes(
self,
max_delivery_bytes: usize,
) -> Result<Self, SourceError>
pub fn with_max_delivery_bytes( self, max_delivery_bytes: usize, ) -> Result<Self, SourceError>
Bound the encoded source delivery before the service adds its outer envelope.
§Errors
Returns SourceError::InvalidDeliverySizeLimit when the limit is zero
or exceeds MAX_DELIVERY_SIZE_BYTES.
Sourcepub fn with_response_limits(self, response_limits: SourceResponseLimits) -> Self
pub fn with_response_limits(self, response_limits: SourceResponseLimits) -> Self
Override hard local decoded-response limits independently of provider soft targets.
Sourcepub fn with_max_resident_sessions(
self,
max_resident_sessions: usize,
) -> Result<Self, SourceError>
pub fn with_max_resident_sessions( self, max_resident_sessions: usize, ) -> Result<Self, SourceError>
Bound the number of distinct session/chain engines retained in memory.
§Errors
Returns SourceError::InvalidSessionLimit when the limit is zero.
Trait Implementations§
Source§impl<F> EventSource for ManagedEventProvider<F>where
F: ChainDataSourceFactory,
impl<F> EventSource for ManagedEventProvider<F>where
F: ChainDataSourceFactory,
Source§fn capabilities(&self) -> SourceCapabilities
fn capabilities(&self) -> SourceCapabilities
Source§fn capabilities_for_chain(&self, chain_id: u64) -> SourceCapabilities
fn capabilities_for_chain(&self, chain_id: u64) -> SourceCapabilities
Source§fn prepare_desired_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
preparation_id: PreparationId,
desired_state: &'life1 ApplyDesiredState,
acknowledged_cursor: Option<&'life2 Cursor>,
) -> Pin<Box<dyn Future<Output = Result<Option<Cursor>, EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn prepare_desired_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
preparation_id: PreparationId,
desired_state: &'life1 ApplyDesiredState,
acknowledged_cursor: Option<&'life2 Cursor>,
) -> Pin<Box<dyn Future<Output = Result<Option<Cursor>, EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn activate_desired_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
preparation_id: PreparationId,
desired_state: &'life1 ApplyDesiredState,
_acknowledged_cursor: Option<&'life2 Cursor>,
) -> Pin<Box<dyn Future<Output = Result<(), EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn activate_desired_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
preparation_id: PreparationId,
desired_state: &'life1 ApplyDesiredState,
_acknowledged_cursor: Option<&'life2 Cursor>,
) -> Pin<Box<dyn Future<Output = Result<(), EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn abort_desired_state<'life0, 'life1, 'async_trait>(
&'life0 self,
preparation_id: PreparationId,
desired_state: &'life1 ApplyDesiredState,
) -> Pin<Box<dyn Future<Output = Result<(), EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn abort_desired_state<'life0, 'life1, 'async_trait>(
&'life0 self,
preparation_id: PreparationId,
desired_state: &'life1 ApplyDesiredState,
) -> Pin<Box<dyn Future<Output = Result<(), EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn release_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
chain_id: u64,
) -> Pin<Box<dyn Future<Output = Result<(), EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn release_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
chain_id: u64,
) -> Pin<Box<dyn Future<Output = Result<(), EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn next_delivery<'life0, 'life1, 'async_trait>(
&'life0 self,
request: DeliveryRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Option<Delivery>, EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn next_delivery<'life0, 'life1, 'async_trait>(
&'life0 self,
request: DeliveryRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Option<Delivery>, EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
None when caught up. Read moreSource§fn wait_for_update<'life0, 'life1, 'async_trait>(
&'life0 self,
request: DeliveryRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<(), EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wait_for_update<'life0, 'life1, 'async_trait>(
&'life0 self,
request: DeliveryRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<(), EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
EventService always keeps its polling interval as a fallback.
The request is identical to the one used for delivery production, so a
push source can wait for a required reorg anchor instead of waking on a
newer but insufficient source hint.
This future is observational: cancellation or Err must not consume a
unique wakeup needed for correctness, because polling remains authoritative. Read moreSource§fn acknowledge<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chain_id: u64,
acknowledgement: &'life1 Acknowledge,
committed_cursor: &'life2 Cursor,
) -> Pin<Box<dyn Future<Output = Result<(), EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn acknowledge<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chain_id: u64,
acknowledgement: &'life1 Acknowledge,
committed_cursor: &'life2 Cursor,
) -> Pin<Box<dyn Future<Output = Result<(), EventSourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl<F> !Freeze for ManagedEventProvider<F>
impl<F> !RefUnwindSafe for ManagedEventProvider<F>
impl<F> !UnwindSafe for ManagedEventProvider<F>
impl<F> Send for ManagedEventProvider<F>
impl<F> Sync for ManagedEventProvider<F>
impl<F> Unpin for ManagedEventProvider<F>
impl<F> UnsafeUnpin for ManagedEventProvider<F>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request