RedisCluster.RedisAdapter behaviour (redis_cluster v0.8.0)

View Source

A behaviour module for Redis adapters. This is intended for mocking Redis in the tests. Though it could also be used to work with Redis libraries other than Redix.

Summary

Callbacks

command(conn, cmd)

@callback command(conn :: pid(), cmd :: [binary()]) :: {:ok, binary()} | {:error, any()}

noreply_pipeline(conn, cmds)

@callback noreply_pipeline(conn :: pid(), cmds :: [[binary()]]) :: :ok | {:error, any()}

pipeline(conn, cmds)

@callback pipeline(conn :: pid(), cmds :: [[binary()]]) ::
  {:ok, [binary()]} | {:error, any()}

start_link(opts)

@callback start_link(opts :: Keyword.t()) :: {:ok, pid()}