Learn

Observable data and lifecycle

Understand replay-latest delivery, ordering, errors, closing, and ownership.

v0.1.0-dev.1Advancedark_data_layer

Observable data and lifecycle

data returns the latest committed value synchronously. stream is a replay-latest broadcast stream: each new listener receives the current value, followed by later commits.

Ordering

Publication is asynchronous. Commits are queued in acceptance order and callbacks never run on the setData call stack. A listener that commits another value does not recursively re-enter itself.

State, not an event log

The stream represents current business data. It is not a durable event log and does not promise exactly-once delivery. Event-history requirements need a transactional outbox, event store, or another durable mechanism.

Closing

close() is idempotent. It rejects later commits, invokes closeRepository(), closes current subscriptions, and keeps the last data value readable. A Repository must not close shared DataSources merely because they appear in its container.

Recommended shutdown order:

  1. bindings that can submit work;
  2. UseCases and application services;
  3. repositories;
  4. DataSources and technical clients.
ARKTELOS

Purpose-built engineering systems for software that has to hold.