eventador 2.1.0
eventador: ^2.1.0 copied to clipboard
Persistence & Event Sourcing Extension for Dactor - Industrial-grade event sourcing platform with hybrid architecture
2.1.0 #
Added #
-
ProjectionActor<T>— adactor-based actor wrapper around aProjection<T>, modelled after Apache Pekko / Akka'sProjectionBehavior. The actor owns the event-stream subscription, drivesprojection.handle(), manages batched checkpoint persistence to Isar, and serves query messages. Spawning is the registration — there is no separate manager to register with; the actor system itself is the registry, exactly as in Pekko.final ref = await system.spawn( 'projection-${projection.projectionId}', () => ProjectionActor(projection, eventStore, isar: isar), ); -
AwaitEventApplied— the canonical CQRS command-to-read-model primitive. A coordinator that just dispatched a command canaskthe projection actor to reply once the projection has applied a matching event:await projectionRef.ask<EventAppliedResponse>( AwaitEventApplied( (e) => e is UserEmailUpdated && e.userId == userId, timeout: Duration(seconds: 5), alreadySatisfied: () => projection.readModel.emailFor(userId) == newEmail, ), );Resolution happens strictly after
projection.handle()returns for the matching event. A handle failure does not advance the checkpoint and does not resolve pending awaiters. Timeouts respond withAwaitFailed(reason: 'timeout'); stopping the actor while awaiters are pending responds withAwaitFailed(reason: 'stopped'). -
Lifecycle message protocol —
GetProjectionInfo,PauseProjection,ResumeProjection,RebuildProjection, andStopProjection(Pekko'sProjectionBehavior.Stopequivalent — flushes the checkpoint, repliesStoppedAck, then terminates the actor).
Notes #
- Additive.
ProjectionManageris unchanged and continues to work for callers that don't need request/response semantics. Existing callers do not need to migrate.ProjectionActorandProjectionManagercan coexist in the same application. - See
doc/projection-actor-proposal.mdfor the full design rationale, Pekko mapping, and invariants.
2.0.0 #
Breaking changes #
- Removed deprecated saga state persistence.
Saga.saveSagaState()andSaga.loadSagaState()(deprecated in 1.0.0) are gone. Use the standardPersistentActorsnapshot mechanism instead: overridegetSnapshotState()andonSnapshot()(or implementonSagaStateRestored()onSaga, which the defaultonSnapshot()calls). CallcreateSnapshot()to persist. - Removed
EventStore.saveSagaState/loadSagaStatefrom the interface andIsarEventStore. CustomEventStoreimplementations no longer need to provide these methods. - Removed
SagaStateEnvelopeand its Isar collection. The schema is no longer registered byIsarEventStore.requiredSchemas. Existing databases withSagaStateEnveloperows will retain the collection on disk but Eventador will not read or write to it. Migrate any persisted saga state to snapshots before upgrading.
Internal cleanup #
- Dropped the redundant
_commandLockfromAggregateRoot. Command serialization is already guaranteed byPersistentActor._handleCommand.
1.0.0 #
Initial pub.dev release.
- Event sourcing framework:
AggregateRoot,Command,Event,Statepatterns - Persistent actor support with Isar-backed event storage (CBOR serialization)
- Snapshot system with configurable frequency and retention strategies
- Saga coordination for distributed, multi-aggregate workflows
- Projection system for CQRS read models with checkpoint-based resumability
EventRegistryfor type-safe event deserialization across system restartsProjectionManagerfor automatic event streaming to registered projections- Built on Dactor actor model and DuraQ durable queuing