Redis.Connection.Behaviour behaviour (Redis v0.8.0)

Copy Markdown View Source

Behaviour defining the Redis connection interface.

Used by higher-level modules (Search, JSON, Consumer, Resilience, etc.) to interact with Redis. Enables testing these modules with Mox without a real Redis connection.

Redis.Connection implements this behaviour.

Summary

Types

command()

@type command() :: [String.t()]

conn()

@type conn() :: GenServer.server()

Callbacks

command(conn, command, keyword)

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

pipeline(conn, list, keyword)

@callback pipeline(conn(), [command()], keyword()) :: {:ok, [term()]} | {:error, term()}

stop(conn)

@callback stop(conn()) :: :ok

transaction(conn, list, keyword)

@callback transaction(conn(), [command()], keyword()) ::
  {:ok, [term()]} | {:error, term()}