Skip to main content

Crate obix

Crate obix 

Source

Re-exports§

pub use inbox::Inbox;
pub use inbox::InboxConfig;
pub use inbox::InboxError;
pub use inbox::InboxEvent;
pub use inbox::InboxEventId;
pub use inbox::InboxEventStatus;
pub use inbox::InboxHandler;
pub use inbox::InboxIdempotencyKey;
pub use inbox::InboxResult;
pub use out::CommitOrder;
pub use out::CursorError;
pub use out::DecodeFailure;
pub use out::Delivery;
pub use out::EventCtx;
pub use out::EventDelivery;
pub use out::FlushError;
pub use out::FlushOp;
pub use out::Handled;
pub use out::InsertOrder;
pub use out::IsolatedOp;
pub use out::KeyedEventCtx;
pub use out::KeyedSubscriber;
pub use out::KeyedSubscriberConfig;
pub use out::Lane;
pub use out::OpCursor;
pub use out::Ordering;
pub use out::Outbox;
pub use out::OutboxEventJobConfig;
pub use out::PartitionMaintainerConfig;
pub use out::Partitions;
pub use out::PostPersistHook;
pub use out::SingletonSubscriber;
pub use out::StagedOp;
pub use out::StreamPosition;
pub use out::StreamSelection;
pub use out::SubscribeError;
pub use out::Subscription;
pub use out::SubscriptionDef;
pub use out::SubscriptionError;
pub use out::SubscriptionSnapshot;
pub use out::SubscriptionStreamStatus;
pub use out::Subscriptions;
pub use out::Suspended;
pub use out::UndecodableDelivery;
pub use out::UndecodableEventError;
pub use out::WakeKey;
pub use out::WakeKeys;

Modules§

inbox
out
prelude

Structs§

CommitGroupId
Identity of the source transaction that published an event: its PostgreSQL top-level transaction id, stamped by a column DEFAULT.
CommitLaneDisabled
The commit lane is off for this outbox. Raised at registration, before any job is spawned, so a consumer that needs the lane fails at startup.
CommitSequence
Position in the commit-ordered lane: dense and gap-free, unlike EventSequence, so a consumer’s cursor needs no contiguity machinery.
EventSequence
MailboxConfig
SubscriptionRow
One subscription’s identity and terms, as stored — everything but the primary key (subscriber_type, key) itself, which the caller already knows from its own lookup.

Enums§

CommitLane
Whether this outbox runs the commit-ordered lane. Opt-in: the fold passes over every event, in every process that runs the outbox.
FrontierError
Why a lane’s frontier could not be read.

Constants§

DEFAULT_BACKFILL_PAGE_SIZE
Ceiling on the rows a single backfill page read may return, and the width of a gap-fill stall episode’s window (an episode’s re-read is a page read, so one episode covers what one page read can see).
DEFAULT_COMMIT_CHECKPOINT_EVERY
How many groups the commit-lane fold emits between sparse checkpoints. The order is computed, so a checkpoint only bounds how far a restart or a lagging subscriber’s backfill has to re-fold.
DEFAULT_COMMIT_CHECKPOINT_INTERVAL
Longest the commit-lane fold goes without a checkpoint while emitting, regardless of group count; see DEFAULT_COMMIT_CHECKPOINT_EVERY.
DEFAULT_GAP_FILL_GRACE
How long the persistent cache waits before the first gap-fill attempt for a stalled broadcast sequence. Most gaps are in-flight transactions that committed out of sequence-allocation order and resolve on their own within a few ms (and this process’s own commit-failed allocations are compensated reactively, never waiting for a fill attempt at all); attempting immediately wastes a page re-read per gap. At high posting rates (hundreds of sequences/s) there is nearly always an in-flight frontier gap, so a sub-second grace is guaranteed-too-short and turns the fill into a permanent background load — hence seconds, not milliseconds. Attempts are read-only until the missing sequences are provably abandoned (every transaction that could have produced them has ended — see MailboxTables::abandonment_proof_passed), so a fill can never collide with a live writer regardless of this setting.
DEFAULT_IDLE_RESYNC_INTERVAL
How long the persistent cache goes without authoritative progress (a newly-seen committed row or a confirmed head read) before polling the sequence head (the O(1) last_value query). Backstops lost wake-ups: a writer crashing between commit and notify, a dead remote notifier, or external writers that never notify.
DEFAULT_NOTIFY_DEBOUNCE
How long the per-process notifier coalesces committed-batch reports before emitting one pg_notify wake-up hint. Notify-bearing commits serialize on a cluster-wide lock, so app transactions no longer notify; this bounds the added cross-process wake-up latency (in-process delivery is unaffected).
DEFAULT_PARTITION_MAINTAINER_INTERVAL
How often the partition maintainer wakes to pre-create partitions ahead of the head. Each tick is idempotent (CREATE ... IF NOT EXISTS), so this is a cheap steady-state poll; premake margin, not cadence, is the safety budget against bursts.
DEFAULT_PARTITION_PREMAKE
How many partitions ahead of the current sequence head the maintainer keeps created — including on the initial synchronous ensure at registration, so a fresh install starts with a multi-partition runway (the migration itself ships only p0 + DEFAULT). premake * width must comfortably exceed the events produced between two maintainer ticks so the head never reaches the last pre-made boundary (which would spill into the DEFAULT partition). Empty partitions are cheap, so this errs generous: 5 * 2M = 10M sequences of headroom by default.
DEFAULT_PARTITION_WIDTH
Width, in sequence units, of each persistent_outbox_events partition.
DEFAULT_PERSIST_EVENTS_BATCH_SIZE

Traits§

MailboxTables

Type Aliases§

PersistentEventRows
One page/batch of decoded persistent rows: each item is one committed sequence position — Ok for a decoded event or a placeholder, Err for a stored payload that does not decode into P.

Derive Macros§

MailboxTables
OutboxEvent