Octoroom.Store.ETS (octoroom v0.1.0)

Copy Markdown View Source

The default Octoroom.Store: an ETS table, snapshotted to a file so it survives a node restarting in place. Enough for one node; a deploy that replaces the machine needs a store outside it.

Options:

  • :name: the table's name (default Octoroom.Store).
  • :path: the snapshot file. Defaults to octoroom-<node>.store in the system temp directory; nil keeps the store in memory only.
  • :snapshot_ms: how long writes are batched before a snapshot (default 50).

Reads and writes go straight to ETS. A write schedules a snapshot, which is written to a temporary file and renamed, so a crash mid-write leaves the previous snapshot.

Summary

Functions

Returns a specification to start this module under a supervisor.

Writes the snapshot now. Returns once it's on disk.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

flush(opts \\ [])

Writes the snapshot now. Returns once it's on disk.

start_link(opts)