eredis (eredis v2.6.2)

Link to this section Summary

Functions

Creates a multibulk command with all the correct size headers
Executes the given command in the specified connection. The command must be a valid Redis command and may contain arbitrary data which will be converted to binaries. The returned values will always be binaries.
Executes the command, and sends a message to this process with the response (with either error or success). Message is of the form {Tag, Reply}, where Reply is the reply expected from q/2.
Executes the command, and sends a message to Pid with the response (with either or success).

See also: q_async/2.

Executes the command but does not wait for a response and ignores any errors.

See also: q/2.

Executes the given pipeline (list of commands) in the specified connection. The commands must be valid Redis commands and may contain arbitrary data which will be converted to binaries. The values returned by each command in the pipeline are returned in a list.
Executes the pipeline, and sends a message to this process with the response (with either error or success). Message is of the form {Tag, Reply}, where Reply is the reply expected from qp/2.
Executes the pipeline but does not wait for a response and ignores any errors.

See also: q/2.

Callback for starting from poolboy

Link to this section Types

Specs

client() ::
    (Pid :: pid()) |
    (Name :: atom()) |
    {Name :: atom(), Node :: atom()} |
    {global, term()} |
    {via, module(), term()}.

Specs

command() :: [term()].
Supports list, atom, binary or integer
Link to this type

continuation_data/0

Specs

continuation_data() :: any().

Specs

host() :: string() | {local, binary() | string()}.

Specs

option() ::
    {transport, transport()} |
    {host, host()} |
    {port, 0..65535} |
    {database, undefined | string()} |
    {password, undefined | string()} |
    {reconnect_sleep, undefined | reconnect_sleep()} |
    {connect_timeout, undefined | non_neg_integer()}.
Link to this type

parser_state/0

Specs

parser_state() :: status_continue | bulk_continue | multibulk_continue.

Specs

pipeline() :: [command()].
Link to this type

reconnect_sleep/0

Specs

reconnect_sleep() :: no_reconnect | non_neg_integer().
Link to this type

return_value/0

Specs

return_value() :: undefined | binary() | [binary() | nonempty_list()].
Link to this type

server_args/0

Specs

server_args() :: [option()].

Specs

transport() :: tcp | ssl.

Link to this section Functions

Link to this function

create_multibulk(Args)

Specs

create_multibulk(Args :: command()) -> Command :: [[command()], ...].
Creates a multibulk command with all the correct size headers
Link to this function

q(Client, Command)

Specs

q(Client :: client(), Command :: command()) ->
     {ok, return_value()} | {error, Reason :: term() | no_connection}.
Executes the given command in the specified connection. The command must be a valid Redis command and may contain arbitrary data which will be converted to binaries. The returned values will always be binaries.
Link to this function

q(Client, Command, Timeout)

Link to this function

q_async(Client, Command)

Specs

q_async(Client :: client(), Command :: command()) -> {await, Tag :: reference()}.
Executes the command, and sends a message to this process with the response (with either error or success). Message is of the form {Tag, Reply}, where Reply is the reply expected from q/2.
Link to this function

q_async(Client, Command, Pid)

Specs

q_async(Client :: client(), Command :: command(), Pid :: pid() | atom()) ->
           {await, Tag :: reference()}.
Executes the command, and sends a message to Pid with the response (with either or success).

See also: q_async/2.

Link to this function

q_noreply(Client, Command)

Specs

q_noreply(Client :: client(), Command :: command()) -> ok.
Executes the command but does not wait for a response and ignores any errors.

See also: q/2.

Link to this function

qp(Client, Pipeline)

Specs

qp(Client :: client(), Pipeline :: pipeline()) ->
      [{ok, return_value()} | {error, Reason :: binary()}] | {error, no_connection}.
Executes the given pipeline (list of commands) in the specified connection. The commands must be valid Redis commands and may contain arbitrary data which will be converted to binaries. The values returned by each command in the pipeline are returned in a list.
Link to this function

qp(Client, Pipeline, Timeout)

Link to this function

qp_async(Client, Pipeline)

Specs

qp_async(Client :: client(), Pipeline :: pipeline()) -> {await, Tag :: reference()}.
Executes the pipeline, and sends a message to this process with the response (with either error or success). Message is of the form {Tag, Reply}, where Reply is the reply expected from qp/2.
Link to this function

qp_async(Client, Pipeline, Pid)

Link to this function

qp_noreply(Client, Pipeline)

Specs

qp_noreply(Client :: client(), Pipeline :: pipeline()) -> ok.
Executes the pipeline but does not wait for a response and ignores any errors.

See also: q/2.

Link to this function

start_link(Args)

Specs

start_link(server_args()) -> {ok, Pid :: pid()} | {error, Reason :: term()}.
Callback for starting from poolboy
Link to this function

start_link(Transport, Host)

Link to this function

start_link(Transport, Host, Port)

Link to this function

start_link(Transport, Host, Port, Database)

Link to this function

start_link(Transport, Host, Port, Database, Password)

Link to this function

start_link(Transport, Host, Port, Database, Password, ReconnectSleep)

Link to this function

start_link(Transport, Host, Port, Database, Password, ReconnectSleep, ConnectTimeout)