application library
Experimental application-layer orchestration APIs.
Exports aggregate, view, repository, metadata, action publishing, and saga manager contracts. This surface is public for the current port, but remains experimental until the application API is release-stabilized.
Classes
-
ActionPublisher<
A, ARM, AM> - Publishes actions produced by a saga manager.
-
EphemeralView<
S, E, Q> - Handles queries by folding fetched events into transient state.
-
EphemeralViewRepository<
E, Q> - Repository contract for resolving a query into a stream of events.
-
EventLockingRepository<
C, E, V, CM, EM> - Stores and retrieves event streams with optimistic locking.
-
EventRepository<
C, E, CM, EM> - Stores and retrieves event streams for event-sourced aggregates.
-
EventSourcingAggregate<
C, S, E, CM, EM> - Handles commands by loading, computing, and saving events.
-
EventSourcingLockingAggregate<
C, S, E, V, CM, EM> - Handles commands with optimistic locking over an event stream.
-
EventSourcingLockingOrchestratingAggregate<
C, S, E, V, CM, EM> - Handles orchestrated commands with optimistic event-stream locking.
-
EventSourcingOrchestratingAggregate<
C, S, E, CM, EM> - Handles commands and recursively persists saga-produced follow-up events.
-
MaterializedLockingDeduplicationView<
S, E, EV, SV, M> - Handles events with optimistic locking and event deduplication.
-
MaterializedLockingView<
S, E, V, M> - Handles events with optimistic locking over projection state.
-
MaterializedView<
S, E, M> - Handles events by updating and persisting projection state.
- NoMetadata
- Marker metadata type for APIs that do not use metadata.
-
SagaManager<
AR, A, ARM, AM> - Coordinates saga reactions and action publishing.
-
StateLockingRepository<
C, S, V, CM, SM> - Stores and retrieves aggregate state with optimistic locking.
-
StateRepository<
C, S, CM, SM> - Stores and retrieves aggregate state for state-stored aggregates.
-
StateStoredAggregate<
C, S, E, CM, SM> - Handles commands by loading, computing, and saving state.
-
StateStoredLockingAggregate<
C, S, E, V, CM, SM> - Handles commands with optimistic locking over stored state.
-
StateStoredLockingOrchestratingAggregate<
C, S, E, V, CM, SM> - Handles orchestrated commands with optimistic state locking.
-
StateStoredOrchestratingAggregate<
C, S, E, CM, SM> - Handles commands and saga-produced follow-up commands over stored state.
-
ViewStateLockingDeduplicationRepository<
E, S, EV, SV, M> - Stores materialized-view state with optimistic locking and deduplication.
-
ViewStateLockingRepository<
E, S, V, M> - Stores and retrieves materialized-view state with optimistic locking.
-
ViewStateRepository<
E, S, M> - Stores and retrieves materialized-view state.
Mixins
-
EventComputation<
C, S, E> - Computes new events from prior events and a command.
-
EventLockingRepositoryDefaults<
C, E, V> - Default implementation of metadata-related methods for EventLockingRepository.
-
EventOrchestratingComputation<
C, S, E> - Computes events and recursively handles saga-produced commands.
-
EventRepositoryDefaults<
C, E> - Default implementation of metadata-related methods for EventRepository.
-
StateComputation<
C, S, E> - Computes new state from current state and a command.
-
StateLockingRepositoryDefaults<
C, S, V> - Default metadata behavior for StateLockingRepository.
-
StateOrchestratingComputation<
C, S, E> - Computes state and recursively handles saga-produced commands.
-
StateRepositoryDefaults<
C, S> - Default metadata behavior for StateRepository.
-
ViewStateComputation<
S, E> -
Mixin that formalizes the
View State Computationalgorithm for View. -
ViewStateLockingDeduplicationRepositoryDefaults<
E, S, EV, SV> - Default metadata behavior for ViewStateLockingDeduplicationRepository.
-
ViewStateLockingRepositoryDefaults<
E, S, V> - Default metadata behavior for ViewStateLockingRepository.
-
ViewStateRepositoryDefaults<
E, S> - Default metadata behavior for ViewStateRepository.
Constants
- noMetadata → const NoMetadata
- Empty metadata value for APIs that do not use metadata.
Functions
-
createActionPublisher<
A, ARM, AM> ({required PublishActions< A> publish, required PublishActionsWithMetadata<A, ARM, AM> publishWithMetadata}) → ActionPublisher<A, ARM, AM> - Creates an ActionPublisher from publish functions.
-
createEphemeralView<
S, E, Q> ({required View< S, E> view, required EphemeralViewRepository<E, Q> ephemeralViewRepository}) → EphemeralView<S, E, Q> - Creates an ephemeral view from a view and event-fetching repository.
-
createEventLockingRepository<
C, E, V> ({required FetchEventsLocking< C, E, V> fetchEvents, required LatestVersionProvider<E, V> latestVersionProvider, required SaveEventsWithProvider<E, V> save, required SaveEventsAtVersion<E, V> saveAtVersion}) → EventLockingRepository<C, E, V, NoMetadata, NoMetadata> - Creates an EventLockingRepository from storage functions.
-
createEventSourcingAggregate<
C, S, E, CM, EM> ({required DeciderContract< C, S, E> decider, required EventRepository<C, E, CM, EM> eventRepository}) → EventSourcingAggregate<C, S, E, CM, EM> - Creates an EventSourcingAggregate from a decider and event repository.
-
createEventSourcingLockingAggregate<
C, S, E, V, CM, EM> ({required DeciderContract< C, S, E> decider, required EventLockingRepository<C, E, V, CM, EM> eventRepository}) → EventSourcingLockingAggregate<C, S, E, V, CM, EM> - Creates a locking event-sourcing aggregate.
-
createEventSourcingLockingOrchestratingAggregate<
C, S, E, V, CM, EM> ({required DeciderContract< C, S, E> decider, required EventLockingRepository<C, E, V, CM, EM> eventRepository, required SagaContract<E, C> saga}) → EventSourcingLockingOrchestratingAggregate<C, S, E, V, CM, EM> - Creates a locking orchestrating event-sourcing aggregate.
-
createEventSourcingOrchestratingAggregate<
C, S, E, CM, EM> ({required DeciderContract< C, S, E> decider, required EventRepository<C, E, CM, EM> eventRepository, required SagaContract<E, C> saga}) → EventSourcingOrchestratingAggregate<C, S, E, CM, EM> - Creates an orchestrating event-sourcing aggregate.
-
createMaterializedLockingDeduplicationView<
S, E, EV, SV, M> ({required View< S, E> view, required ViewStateLockingDeduplicationRepository<E, S, EV, SV, M> viewStateLockingDeduplicationRepository}) → MaterializedLockingDeduplicationView<S, E, EV, SV, M> - Creates a locking deduplicating materialized view.
-
createMaterializedLockingView<
S, E, V, M> ({required View< S, E> view, required ViewStateLockingRepository<E, S, V, M> viewStateLockingRepository}) → MaterializedLockingView<S, E, V, M> - Creates a locking materialized view.
-
createMaterializedView<
S, E, M> ({required View< S, E> view, required ViewStateRepository<E, S, M> viewStateRepository}) → MaterializedView<S, E, M> - Creates a materialized view from a view and state repository.
-
createSagaManager<
AR, A, ARM, AM> ({required SagaContract< AR, A> saga, required ActionPublisher<A, ARM, AM> actionPublisher}) → SagaManager<AR, A, ARM, AM> -
Creates a SagaManager from a
sagaandactionPublisher. -
createStateStoredAggregate<
C, S, E, CM, SM> ({required DeciderContract< C, S, E> decider, required StateRepository<C, S, CM, SM> stateRepository}) → StateStoredAggregate<C, S, E, CM, SM> - Creates a state-stored aggregate from a decider and state repository.
-
createStateStoredLockingAggregate<
C, S, E, V, CM, SM> ({required DeciderContract< C, S, E> decider, required StateLockingRepository<C, S, V, CM, SM> stateRepository}) → StateStoredLockingAggregate<C, S, E, V, CM, SM> - Creates a locking state-stored aggregate.
-
createStateStoredLockingOrchestratingAggregate<
C, S, E, V, CM, SM> ({required DeciderContract< C, S, E> decider, required StateLockingRepository<C, S, V, CM, SM> stateRepository, required SagaContract<E, C> saga}) → StateStoredLockingOrchestratingAggregate<C, S, E, V, CM, SM> - Creates a locking orchestrating state-stored aggregate.
-
createStateStoredOrchestratingAggregate<
C, S, E, CM, SM> ({required DeciderContract< C, S, E> decider, required StateRepository<C, S, CM, SM> stateRepository, required SagaContract<E, C> saga}) → StateStoredOrchestratingAggregate<C, S, E, CM, SM> - Creates an orchestrating state-stored aggregate.
Typedefs
-
FetchEventsLocking<
C, E, V> = Stream< (E, V)> Function(C command) - Fetches events with their storage versions.
-
LatestVersionProvider<
E, V> = V? Function(E event) - Returns the version associated with an event.
-
MapMetadata
= Map<
String, Object> - Convenience metadata type for map-based integrations.
-
PublishActions<
A> = Stream< A> Function(Stream<A> actions) - Function that publishes actions without metadata.
-
PublishActionsWithMetadata<
A, ARM, AM> = Stream< (A, AM)> Function(Stream<(A, ARM)> actions) - Function that publishes actions and maps result metadata to action metadata.
-
SaveEventsAtVersion<
E, V> = Stream< (E, V)> Function(Stream<E> events, V? latestVersion) - Saves events using an explicit latest expected version.
-
SaveEventsWithProvider<
E, V> = Stream< (E, V)> Function(Stream<E> events, LatestVersionProvider<E, V> latestVersionProvider) - Saves events using a provider for the latest expected version.