Davy.Backend.InMemory (davy v0.3.1)

Copy Markdown View Source

An in-memory reference implementation of the Davy.Backend behaviour.

Stores resources in a named ETS table owned by the calling process. Useful for:

  • Smoke testing with mix davy.serve — the task defaults to this backend.
  • Studying the Davy.Backend behaviour — the callbacks are small enough to read end-to-end.
  • Exercising the server in tests that don't need real storage.

Call start/0 once (typically in test setup or when standing up a demo server) before routing requests to it.

Not suitable for production

Data lives in a named ETS table owned by the calling process and is lost when that process exits. There is no persistence, no multi-node coordination, and no access control beyond a placeholder authenticate/1 that accepts everything.

Summary

Functions

Reset to an empty state. Equivalent to start/0.

(Re)initialise the ETS table and install an empty root collection.

Functions

reset()

@spec reset() :: :ok

Reset to an empty state. Equivalent to start/0.

start()

@spec start() :: :ok

(Re)initialise the ETS table and install an empty root collection.