eventador 2.1.0 copy "eventador: ^2.1.0" to clipboard
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> — a dactor-based actor wrapper around a Projection<T>, modelled after Apache Pekko / Akka's ProjectionBehavior. The actor owns the event-stream subscription, drives projection.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 can ask the 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 with AwaitFailed(reason: 'timeout'); stopping the actor while awaiters are pending responds with AwaitFailed(reason: 'stopped').

  • Lifecycle message protocolGetProjectionInfo, PauseProjection, ResumeProjection, RebuildProjection, and StopProjection (Pekko's ProjectionBehavior.Stop equivalent — flushes the checkpoint, replies StoppedAck, then terminates the actor).

Notes #

  • Additive. ProjectionManager is unchanged and continues to work for callers that don't need request/response semantics. Existing callers do not need to migrate. ProjectionActor and ProjectionManager can coexist in the same application.
  • See doc/projection-actor-proposal.md for the full design rationale, Pekko mapping, and invariants.

2.0.0 #

Breaking changes #

  • Removed deprecated saga state persistence. Saga.saveSagaState() and Saga.loadSagaState() (deprecated in 1.0.0) are gone. Use the standard PersistentActor snapshot mechanism instead: override getSnapshotState() and onSnapshot() (or implement onSagaStateRestored() on Saga, which the default onSnapshot() calls). Call createSnapshot() to persist.
  • Removed EventStore.saveSagaState / loadSagaState from the interface and IsarEventStore. Custom EventStore implementations no longer need to provide these methods.
  • Removed SagaStateEnvelope and its Isar collection. The schema is no longer registered by IsarEventStore.requiredSchemas. Existing databases with SagaStateEnvelope rows 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 _commandLock from AggregateRoot. Command serialization is already guaranteed by PersistentActor._handleCommand.

1.0.0 #

Initial pub.dev release.

  • Event sourcing framework: AggregateRoot, Command, Event, State patterns
  • 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
  • EventRegistry for type-safe event deserialization across system restarts
  • ProjectionManager for automatic event streaming to registered projections
  • Built on Dactor actor model and DuraQ durable queuing
1
likes
140
points
192
downloads

Documentation

API reference

Publisher

verified publisherwerkswinkel.com

Weekly Downloads

Persistence & Event Sourcing Extension for Dactor - Industrial-grade event sourcing platform with hybrid architecture

Repository (GitHub)

License

MIT (license)

Dependencies

cbor, dactor, duraq, isar, meta, synchronized

More

Packages that depend on eventador