Concord.Engine behaviour (Concord v2.4.0)

Copy Markdown View Source

Storage engine boundary for Concord's public KV surface.

Concord uses Concord.Engine.Cluster by default to preserve the current Raft-backed behavior. Explicit APIs such as Concord.Local pass a different engine per call.

Summary

Types

command()

@type command() :: term()

query()

@type query() :: term()

reason()

@type reason() :: term()

Callbacks

command(command, keyword)

@callback command(
  command(),
  keyword()
) :: {:ok, term()} | {:error, reason()}

members(keyword)

@callback members(keyword()) :: {:ok, list()} | {:error, reason()}

query(query, keyword)

@callback query(
  query(),
  keyword()
) :: {:ok, term()} | {:error, reason()}

status(keyword)

@callback status(keyword()) :: {:ok, map()} | {:error, reason()}

Functions

command(command, opts \\ [])

@spec command(
  command(),
  keyword()
) :: {:ok, term()} | {:error, reason()}

members(opts \\ [])

@spec members(keyword()) :: {:ok, list()} | {:error, reason()}

query(query, opts \\ [])

@spec query(
  query(),
  keyword()
) :: {:ok, term()} | {:error, reason()}

status(opts \\ [])

@spec status(keyword()) :: {:ok, map()} | {:error, reason()}