| redis_config {redux} | R Documentation |
Redis configuration
Description
Create a set of valid Redis configuration options.
Usage
redis_config(..., config = list(...))
Arguments
... |
See Details |
config |
A list of options, to use in place of |
Details
Valid arguments here are:
urlThe URL for the Redis server. See examples. (default: Look up environment variable
REDIS_URLorNULL).hostThe hostname of the Redis server. (default:
127.0.0.1).portThe port of the Redis server. (default: 6379).
pathThe path for a Unix socket if connecting that way.
passwordThe Redis password (for use with
AUTH). This will be stored in plain text as part of the Redis object. (default:NULL).dbThe Redis database number to use (for use with
SELECT. Do not use in a redis clustering context. (default:NULL; i.e., don't switch).timeoutThe maximum number of milliseconds to wait for the connection to be established. (default:
NULL; i.e. wait forever).
The way that configuration options are resolved follows the design for redis-rb very closely.
First, look up (and parse if found) the
REDIS_URLenvironment variable and override defaults with that.Any arguments given (
host,port,password,db) override values inferred from the url or defaults.If
pathis given, that overrides thehost/portsettings and a socket connection will be used.
Examples
# default config:
redis_config()
# set values
redis_config(host = "myhost")
# url settings:
redis_config(url = "redis://:p4ssw0rd@myhost:32000/2")
# override url settings:
redis_config(url = "redis://myhost:32000", port = 31000)
redis_config(url = "redis://myhost:32000", path = "/tmp/redis.conf")