class Redis

Overview

The class is the main entry point for the Redis client.

How to use:

Require the package:

require "redis"

Then instantiate this client class:

redis = Redis.new

Then you can call Redis commands on the redis object:

redis.set("foo", "bar")
redis.get("foo")
redis.incr("visitors")

See the mixin module Commands for most of the available Redis commands such as #incr, #rename, and so on.

Multithreading / Coroutines

Please mind that a Redis object can't be shared across multiple threads/coroutines! Each thread/coroutine that wants to talk to Redis needs its own Redis object instance.

Included Modules

Defined in:

lib/redis-cluster/src/ext/redis/commands.cr
lib/redis-cluster/src/ext/redis/each.cr
lib/redis/src/redis.cr
lib/redis/src/redis/command_execution/future_oriented.cr
lib/redis/src/redis/command_execution/value_oriented.cr
lib/redis/src/redis/commands.cr
lib/redis/src/redis/strategy/base.cr
redis_service_manager/redis_ext.cr

Instance methods inherited from module Redis::Commands

getex(key, ex = nil, px = nil, exat = nil, pxat = nil) getex