Redix
Setup
Redix uses bidirecitonal TCP so can handle multiple request at same time. Might new Redix pool if maps 1to1 to user requests
Then user with name Redix.command(:redix, ["PING"])
Usage
Redix is simple: it doesn't wrap Redis commands with Elixir functions. It only provides functions to send any Redis command to the Redis server. A Redis command is expressed as a list of strings making up the command and its arguments.
Connections are started via start_link/0,1,2
:
Commands can be sent using Redix.command/2,3
:
Pipelines are just lists of commands sent all at once to Redis for which Redis replies with a list of responses. They can be used in Redix via Redix.pipeline/2,3
:
Redix.command/2,3
and Redix.pipeline/2,3
always return {:ok, result}
or {:error, reason}
. If you want to access the result directly and raise in case there's an error, bang! variants are provided:
Last updated