eventsourcing/memory_store

Types

pub type EventMessage(event) {
  SetEvents(
    key: String,
    value: List(eventsourcing.EventEnvelop(event)),
  )
  GetEvents(
    key: String,
    response: process.Subject(
      option.Option(List(eventsourcing.EventEnvelop(event))),
    ),
  )
}

Constructors

pub opaque type MemoryStore(entity, command, event, error)
pub type SnapshotMessage(entity) {
  SetSnapshot(key: String, value: eventsourcing.Snapshot(entity))
  GetSnapshot(
    key: String,
    response: process.Subject(
      option.Option(eventsourcing.Snapshot(entity)),
    ),
  )
}

Constructors

Values

pub fn new() -> Result(
  eventsourcing.EventStore(
    MemoryStore(a, b, c, d),
    a,
    b,
    c,
    d,
    MemoryStore(a, b, c, d),
  ),
  actor.StartError,
)

Create a new memory store record.

pub fn supervised(
  event_store_receiver: process.Subject(
    eventsourcing.EventStore(
      MemoryStore(entity, command, event, error),
      entity,
      command,
      event,
      error,
      MemoryStore(entity, command, event, error),
    ),
  ),
) -> #(
  supervision.ChildSpecification(
    process.Subject(EventMessage(event)),
  ),
  supervision.ChildSpecification(
    process.Subject(SnapshotMessage(entity)),
  ),
)
Search Document