howdy/flags/memory

Flag settings kept in one process, for tests and for an app on a single node without a database. Everything is lost when the process stops, and other nodes do not see it.

let store = memory.new()
let assert Ok(features) =
  flags.new(store) |> flags.register(my_app.all_flags()) |> flags.start

stop ends the process. Every call to the store, from then on or from a store that stops answering, returns Error(service.Internal) rather than crashing the caller.

Values

pub fn from(snapshot: flags.Snapshot) -> flags.Store

A store holding a snapshot to start with, such as one read with flags.snapshot_decoder from a file.

pub fn new() -> flags.Store

An empty store, in a process linked to the caller.

pub fn stop(store: flags.Store) -> Nil

End the store’s process. Everything it held is gone, and every later call to it, including from flags still running on it, returns an error. Stopping a store that has already stopped does nothing.

✨ Search Document