Skip to main content

ManagedEventProvider

Struct ManagedEventProvider 

Source
pub struct ManagedEventProvider<F>{ /* 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>

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn with_response_limits(self, response_limits: SourceResponseLimits) -> Self

Override hard local decoded-response limits independently of provider soft targets.

Source

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>

Source§

fn capabilities(&self) -> SourceCapabilities

Advertise the guarantees and topology implemented by this source.
Source§

fn capabilities_for_chain(&self, chain_id: u64) -> SourceCapabilities

Advertise guarantees for a particular chain. Multi-chain sources should override this; single-capability sources retain the legacy behavior.
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,

Validate and fully prepare a desired state before it becomes durable. Read more
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,

Activate a previously prepared desired state after its durable commit. Read more
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,

Discard a prepared desired state when its durable commit fails. Read more
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,

Release all process-local state for a stream that owned this durable session. The service invokes this at most once for each successfully negotiated lease, after it stops using every other source method. Read more
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,

Produce the next delivery after the durable cursor, or None when caught up. Read more
Source§

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,

Wait until the source reports that a newer archive height may be available. Providers without a push signal can retain the default; 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 more
Source§

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,

Reconcile provider-local state after the service has already committed runtime ingestion and its durable cursor. Read more

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>
where Mutex<ProviderState<<F as ChainDataSourceFactory>::Source>>: Send,

§

impl<F> Sync for ManagedEventProvider<F>
where Mutex<ProviderState<<F as ChainDataSourceFactory>::Source>>: Sync,

§

impl<F> Unpin for ManagedEventProvider<F>
where F: Unpin, Mutex<ProviderState<<F as ChainDataSourceFactory>::Source>>: Unpin,

§

impl<F> UnsafeUnpin for ManagedEventProvider<F>
where F: UnsafeUnpin, Mutex<ProviderState<<F as ChainDataSourceFactory>::Source>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more