tobogganSe connecter

packages

The Louise packages, each released on its own

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

NomDernier commitDate
src/packages/eventsourcing: an event's data can be redacted in place (ADR 0078)il y a 2 sem.
test/packages/eventsourcing: an event's data can be redacted in place (ADR 0078)il y a 2 sem.
CHANGELOG.mdA repository of its own: README, CI, release checks, fixturesil y a 5 j
louise.tomlVersion every package 0.21.0, on louise 0.22.0il y a 5 j
README.mdpackages/eventsourcing: an event's data can be redacted in place (ADR 0078)il y a 2 sem.
README.MD

eventsourcing

Event sourcing for Louise apps: aggregates as deciders, an event store behind an effect (in memory, in process, or in PostgreSQL), a state cache per aggregate, catch-up projections, and values sealed at rest. It is the infrastructure toki2 and Starfleet API grew, shared so the two copies stop drifting (ADR 0076).

import eventsourcing/aggregate.{type Aggregate, Aggregate}
import eventsourcing/decider.{type Decider, Decider}

pub fn decider :: -> Decider<Command, Event, State, Rejection>
{
  Decider(initial: Unregistered, evolve: evolve, decide: decide)
}

// One stream per aggregate: `account-<id>`, its events in `codec`'s form.
pub fn accounts :: -> Aggregate<Command, Event, State, Rejection>
{
  Aggregate("account", decider (), account_codec.codec (), aggregate.own_partition)
}

aggregate.execute (accounts ()) cache (id.text account_id) Register(name, hash, now)
ModuleWhat
deciderDecider(initial, evolve, decide), replay, fold, decide: pure.
codec, payloadAn event's stored form: a kind and a MessagePack map, with typed fields.
aggregateLoad a state (from its cache, then only newer events) and execute a command at the expected version, retried with backoff on a conflict.
state_cacheThe latest (version, state) of each aggregate, in one actor; forget drops one after its events were redacted.
troubleFailed, Busy or Contended: what store trouble means to a caller.
projectionViews folded from the whole log or one partition, caught up in batches.
event_storeThe port (an effect). Adapters: event_store/memory (a pure log), event_store/in_process (an actor), event_store/postgres/stored_events (PostgreSQL, each value sealed). redact gives one stored event new data in place, to erase what a person asked to have forgotten (ADR 0078).
event_store/postgres/schemamigrate: the events and schema_changes tables, under an advisory lock. An app's own tables are the app's.
sealingChaCha20-Poly1305 with a key derived from a root key under the app's label, each value bound to its row.
id, backoffUUIDv7 ids in Crockford base 32; the pause between conflicting attempts.

louise test runs every test; the PostgreSQL ones need LOUISE_PG_URL and skip without it. Run them natively with --jobs 1.