liveBook · Manning

In-memory event store

As explained in Build and Orchestrator in Go (From Scratch)

An in-memory event store is a store implementation that keeps task event records in memory.

An in-memory event store keeps task event records in memory and exposes them through the Store interface. The manager selects it when dbType is "memory", assigning it to EventDb. section 11.5

Its operational role is deliberately small:

  • Allow the manager to replace the implementation later through the dbType selection. section 11.5

Recording a task event

The manager removes an event from its pending queue, converts it to a task event, and stores it under the event ID: m.EventDb.Put(te.ID.String(), &te). Storage errors are logged and stop the operation.

How Build and Orchestrator in Go (From Scratch) covers it

How deep it goes
Explains construction and Put-based use, while deferring the store implementation and persistence across process lifetimes.
Examples
Uses a dbType switch and an EventDb.Put call keyed by a task event ID.
What it assumes
Assumes familiarity with the Store interface, Manager state, task events, and queued work.
What you can do after
Operate/configure the manager to record dequeued task events through EventDb.
How it connects
Links task events with the Manager, Store interface, pending queue, and persistent task storage.

This explainer was generated by Manning's knowledge graph from the text of Build and Orchestrator in Go (From Scratch). The section links point to the parts of the book it draws on.