Skip to main content

Module subscription

Module subscription 

Source
Expand description

§Reactive Subscription System

Foundation types for the push-based subscription system that delivers change events from materialized views and streaming queries to consumers.

§Architecture

The subscription system spans all three rings:

  • Ring 0: NotificationRef — zero-allocation, cache-line-aligned notification
  • Ring 1: ChangeEvent — data delivery with Arc<RecordBatch> payloads
  • Ring 2: Subscription lifecycle management

§Types

  • EventType — Discriminant for change event kinds (Insert/Delete/Update/Watermark/Snapshot)
  • NotificationRef — 64-byte cache-aligned Ring 0 notification slot
  • ChangeEvent — Rich change event with Arrow data for Ring 1 delivery
  • ChangeEventBatch — Coalesced batch of change events

Structs§

BackpressureController
Per-subscription backpressure controller.
BatchConfig
Configuration for notification batching.
CallbackSubscriptionHandle
Handle for a callback-based subscription.
ChangeEventBatch
A batch of change events for coalesced delivery to subscribers.
ChangeEventResultStream
Async stream that also yields lag errors.
ChangeEventStream
Async stream wrapper for push subscriptions.
DemandBackpressure
Demand-based backpressure (Reactive Streams request(n) model).
DemandHandle
Handle given to the subscriber to request more events.
DispatcherConfig
Configuration for the SubscriptionDispatcher.
DispatcherMetrics
Atomic counters for monitoring the dispatcher.
NotificationBatcher
Accumulates events per source and flushes as batches.
NotificationHub
Manages notification slots and the SPSC ring for a single reactor core.
NotificationRef
Zero-allocation notification reference for Ring 0.
NotificationRing
Lock-free SPSC ring buffer carrying NotificationRef from Ring 0 to Ring 1.
NotificationSlot
Per-source notification slot with atomic sequence counter.
PushSubscription
A push-based subscription handle.
StringInternTable
Intern table for string values used in Ring 0 predicates.
SubscriptionConfig
Configuration for a subscription.
SubscriptionDispatcher
Ring 1 dispatcher that routes notifications to subscriber channels.
SubscriptionEntry
A registered subscription entry with state, config, channel, and metrics.
SubscriptionFilter
Compiled subscription filter.
SubscriptionId
Unique subscription identifier.
SubscriptionMetrics
Point-in-time metrics snapshot for a subscription.
SubscriptionRegistry
Registry managing all active subscriptions.

Enums§

BackpressureStrategy
Strategy applied when a subscription’s channel buffer is full.
ChangeEvent
A change event carrying Arrow data for subscriber delivery.
EventType
Discriminant for change event kinds.
FilterCompileError
Filter compilation errors.
PushSubscriptionError
Errors from push subscription operations.
Ring0Predicate
Ring 0 predicate (must be zero-allocation, < 50ns).
Ring1Predicate
Ring 1 predicate (can allocate, evaluated in Ring 1 dispatcher).
ScalarValue
Scalar value for Ring 0 predicate comparison.
SubscriptionState
Lifecycle state of a subscription.

Traits§

NotificationDataSource
Resolves a NotificationRef into a full ChangeEvent.
SubscriptionCallback
Callback trait for push-based subscriptions.

Functions§

compile_filter
Compiles a filter expression into Ring 0 and Ring 1 predicates.
subscribe_callback
Creates a callback-based subscription.
subscribe_fn
Creates a closure-based subscription (convenience wrapper).
subscribe_stream
Creates an async Stream subscription.
subscribe_stream_with_errors
Creates an async Stream that also yields errors.