+Host, +Port)Connect to a redis server. The main mode is
redis_connect(+Address, -Connection, +Options). redis_connect/1
is equivalent to
redis_connect(localhost:6379, Connection, ). Options:
true, try to reconnect to the service when the
connection seems lost. Default is
true for connections
for explictly opened connections.
specified, these are used to authenticate using the HELLO
- Authenticate using Password
- Specify the connection protocol version. Initially this is version 2.
Redis 6 also supports version 3. When specified as
3, the HELLO
command is used to upgrade the protocol.
- When specified, initiate a TLS connection. If this option is specified
we must also specify the
- CA Certificate file to verify with.
- Client certificate to authenticate with.
- Private key file to authenticate with.
- Used together with an Address of the form
to enable contacting a network of Redis servers guarded by a sentinel
- Authentication information for the senitels. When omitted we try to
connect withour authentication.
Instead of using these predicates, redis/2
and redis/3 are normally used with a server
name argument registered using redis_server/3.
These predicates are meant for creating a temporary paralel connection
or using a connection with a blocking call.
|Address ||is a term Host:Port, |
or the name of a server registered using redis_server/3.
The latter realises a new connection that is typically used for
blocking redis commands such as listening for published messages,
waiting on a list or stream.
redis_connect(-Connection, +Host, +Port) provides
compatibility to the original GNU-Prolog interface and is equivalent to
redis_connect(Host:Port, Connection, ).