ExESDB.PersistenceWorker (ex_esdb v0.11.0)

A GenServer that handles periodic disk persistence operations.

This worker batches and schedules fence operations to ensure data is persisted to disk without blocking event append operations.

Features:

  • Configurable persistence interval (default: 5 seconds)
  • Batching of fence operations to reduce disk I/O
  • Graceful shutdown with final persistence
  • Per-store persistence workers

Summary

Functions

Returns a specification to start this module under a supervisor.

Forces immediate persistence of all pending stores. This is a synchronous call that blocks until persistence is complete.

Requests that a store's data be persisted to disk. This is a non-blocking call that queues the store for persistence.

Starts a persistence worker for a specific store.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

force_persistence(store_id)

Forces immediate persistence of all pending stores. This is a synchronous call that blocks until persistence is complete.

request_persistence(store_id)

Requests that a store's data be persisted to disk. This is a non-blocking call that queues the store for persistence.

start_link(opts)

Starts a persistence worker for a specific store.