From 14f0c6a044f586d7cb251d27bde0e085f0be70db Mon Sep 17 00:00:00 2001 From: Stefan Wille Date: Wed, 21 Aug 2019 12:45:59 +0200 Subject: [PATCH] Bump version --- README.md | 2 +- docs/Redis.html | 94 +-- docs/Redis/CannotConnectError.html | 2 +- docs/Redis/CommandTimeoutError.html | 2 +- docs/Redis/Commands.html | 915 +++++++++++++++++++++------- docs/Redis/ConnectionError.html | 2 +- docs/Redis/ConnectionLostError.html | 2 +- docs/Redis/Error.html | 2 +- docs/Redis/Future.html | 8 +- docs/Redis/PipelineApi.html | 76 +-- docs/Redis/PoolTimeoutError.html | 2 +- docs/Redis/PooledClient.html | 12 +- docs/Redis/SocketWrapper.html | 10 +- docs/Redis/Subscription.html | 14 +- docs/Redis/TransactionApi.html | 78 +-- docs/index.html | 2 +- docs/index.json | 2 +- docs/search-index.js | 2 +- shard.yml | 2 +- 19 files changed, 844 insertions(+), 385 deletions(-) diff --git a/README.md b/README.md index a7c2c6c..5c0fbaf 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Add it to your `shard.yml`: dependencies: redis: github: stefanwille/crystal-redis - version: ~> 2.2.1 + version: ~> 2.3.0 ``` and then install the library into your project: diff --git a/docs/Redis.html b/docs/Redis.html index 2fb9f67..8c5fc0b 100644 --- a/docs/Redis.html +++ b/docs/Redis.html @@ -183,35 +183,35 @@

Included Modules

Defined in:

- + redis/commands.cr
- + redis/command_execution/value_oriented.cr
- + redis.cr
- + redis/command_execution/future_oriented.cr
- + redis/strategy/base.cr @@ -378,8 +378,8 @@

Instance methods inherited from module R bitcount, - - bitop(operation, key, *keys) + + bitop(operation, key, *keys : String) : Int64
bitop(operation, key, keys : Array(String)) : Int64
bitop
, @@ -523,8 +523,8 @@

Instance methods inherited from module R hlen, - - hmget(key, *fields) + + hmget(key, *fields : String) : Array(RedisValue)
hmget(key, fields : Array(String)) : Array(RedisValue)
hmget
, @@ -628,8 +628,8 @@

Instance methods inherited from module R ltrim, - - mget(*keys)
mget(keys : Array)
+
+ mget(keys : Array(String)) : Array(RedisValue)
mget(*keys)
mget
, @@ -673,18 +673,18 @@

Instance methods inherited from module R pexpireat, - - pfadd(key, *values) + + pfadd(key, *values : String) : Int64
pfadd(key, values : Array(String)) : Int64
pfadd
, - - pfcount(*keys) + + pfcount(keys : Array(String)) : Int64
pfcount(*keys : String) : Int64
pfcount
, - - pfmerge(*keys) + + pfmerge(keys : Array(String))
pfmerge(*keys : String)
pfmerge
, @@ -699,7 +699,7 @@

Instance methods inherited from module R - psubscribe(*channel_patterns)
psubscribe(*channel_patterns, &callback_setup_block : Subscription -> )
+ psubscribe(*channel_patterns)
psubscribe(channel_patterns : Array(String))
psubscribe(*channel_patterns, &callback_setup_block : Subscription -> )
psubscribe
, @@ -714,7 +714,7 @@

Instance methods inherited from module R - punsubscribe(*channel_patterns) + punsubscribe(*channel_patterns)
punsubscribe(channel_patterns : Array(String))
punsubscribe
, @@ -753,8 +753,8 @@

Instance methods inherited from module R rpoplpush, - - rpush(key, *values) + + rpush(key, *values : String)
rpush(key, values : Array(RedisValue))
rpush
, @@ -798,13 +798,13 @@

Instance methods inherited from module R script_load, - - sdiff(*keys) + + sdiff(keys : Array(String)) : Array(RedisValue)
sdiff(*keys : String) : Array(RedisValue)
sdiff
, - - sdiffstore(destination, *keys) + + sdiffstore(destination, *keys : String) : Int64
sdiffstore(destination, keys : Array(String)) : Int64
sdiffstore
, @@ -838,13 +838,13 @@

Instance methods inherited from module R setrange, - - sinter(*keys) + + sinter(keys : Array(String)) : Array(RedisValue)
sinter(*keys : String) : Array(RedisValue)
sinter
, - - sinterstore(destination_key, *keys) + + sinterstore(destination_key, *keys : String) : Int64
sinterstore(destination_key, keys : Array(String)) : Int64
sinterstore
, @@ -893,18 +893,18 @@

Instance methods inherited from module R strlen, - - subscribe(*channels, &callback_setup_block : Subscription -> )
subscribe(*channels)
+
+ subscribe(channels : Array(String)) : Void
subscribe(*channels : String)
subscribe(*channels, &callback_setup_block : Subscription -> )
subscribe
, - - sunion(*keys) + + sunion(keys : Array(String))
sunion(*keys : String)
sunion
, - - sunionstore(destination, *keys) + + sunionstore(destination, keys : Array(String)) : Int64
sunionstore(destination, *keys : String) : Int64
sunionstore
, @@ -918,8 +918,8 @@

Instance methods inherited from module R type, - - unsubscribe(*channels) + + unsubscribe(channels : Array(String)) : Nil
unsubscribe(*channels)
unsubscribe
, @@ -928,13 +928,13 @@

Instance methods inherited from module R unwatch, - - watch(*keys) + + watch(keys : Array(String))
watch(*keys)
watch
, - - zadd(key, scores_and_members : Array(RedisValue))
zadd(key, *scores_and_members)
+
+ zadd(key, *scores_and_members)
zadd(key, scores_and_members : Array(RedisValue))
zadd
, @@ -1110,7 +1110,7 @@

Constructor Detail


@@ -1143,7 +1143,7 @@

Class Method Detail


@@ -1166,7 +1166,7 @@

Instance Method Detail


@@ -1202,7 +1202,7 @@

Instance Method Detail


@@ -1237,7 +1237,7 @@

Instance Method Detail


@@ -1255,7 +1255,7 @@

Instance Method Detail


diff --git a/docs/Redis/CannotConnectError.html b/docs/Redis/CannotConnectError.html index 344fb95..930dd69 100644 --- a/docs/Redis/CannotConnectError.html +++ b/docs/Redis/CannotConnectError.html @@ -150,7 +150,7 @@

Overview

Defined in:

- + redis/error.cr diff --git a/docs/Redis/CommandTimeoutError.html b/docs/Redis/CommandTimeoutError.html index 895dcaf..a1155ad 100644 --- a/docs/Redis/CommandTimeoutError.html +++ b/docs/Redis/CommandTimeoutError.html @@ -150,7 +150,7 @@

Overview

Defined in:

- + redis/error.cr diff --git a/docs/Redis/Commands.html b/docs/Redis/Commands.html index f8c4a93..188201b 100644 --- a/docs/Redis/Commands.html +++ b/docs/Redis/Commands.html @@ -159,7 +159,7 @@

Direct including types

Defined in:

- + redis/commands.cr @@ -199,7 +199,14 @@

Instance Method Summary

  • - #bitop(operation, key, *keys) + #bitop(operation, key, *keys : String) : Int64 + +

    Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

    + +
  • + +
  • + #bitop(operation, key, keys : Array(String)) : Int64

    Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

    @@ -409,7 +416,14 @@

    Instance Method Summary

  • - #hmget(key, *fields) + #hmget(key, *fields : String) : Array(RedisValue) + +

    Returns the values associated with the specified fields in the hash stored at key.

    + +
  • + +
  • + #hmget(key, fields : Array(String)) : Array(RedisValue)

    Returns the values associated with the specified fields in the hash stored at key.

    @@ -523,6 +537,8 @@

    Instance Method Summary

  • #lpush(key, values : Array(RedisValue)) +

    Insert all the specified values at the head of the list stored at key.

    +
  • @@ -561,14 +577,14 @@

    Instance Method Summary

  • - #mget(*keys) - -

    Returns the values of all specified keys.

    + #mget(keys : Array(String)) : Array(RedisValue)
  • - #mget(keys : Array) + #mget(*keys) + +

    Returns the values of all specified keys.

  • @@ -629,21 +645,42 @@

    Instance Method Summary

  • - #pfadd(key, *values) + #pfadd(key, *values : String) : Int64

    Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.

  • - #pfcount(*keys) + #pfadd(key, values : Array(String)) : Int64 + +

    Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.

    + +
  • + +
  • + #pfcount(keys : Array(String)) : Int64

    When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.

  • - #pfmerge(*keys) + #pfcount(*keys : String) : Int64 + +

    When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.

    + +
  • + +
  • + #pfmerge(keys : Array(String)) + +

    Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.

    + +
  • + +
  • + #pfmerge(*keys : String)

    Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.

    @@ -666,6 +703,11 @@

    Instance Method Summary

  • #psubscribe(*channel_patterns) +
  • + +
  • + #psubscribe(channel_patterns : Array(String)) +

    Subscribes to more channel patterns while already being in a subscription loop.

  • @@ -698,6 +740,13 @@

    Instance Method Summary

    +
  • + #punsubscribe(channel_patterns : Array(String)) + +

    Unsubscribes the client from the given patterns, or from all of them if none is given.

    + +
  • +
  • #quit @@ -748,7 +797,14 @@

    Instance Method Summary

  • - #rpush(key, *values) + #rpush(key, *values : String) + +

    Insert all the specified values at the tail of the list stored at key.

    + +
  • + +
  • + #rpush(key, values : Array(RedisValue))

    Insert all the specified values at the tail of the list stored at key.

    @@ -816,14 +872,26 @@

    Instance Method Summary

  • - #sdiff(*keys) + #sdiff(keys : Array(String)) : Array(RedisValue)

    Returns the members of the set resulting from the difference between the first set and all the successive sets.

  • - #sdiffstore(destination, *keys) + #sdiff(*keys : String) : Array(RedisValue) + +
  • + +
  • + #sdiffstore(destination, *keys : String) : Int64 + +

    This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

    + +
  • + +
  • + #sdiffstore(destination, keys : Array(String)) : Int64

    This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

    @@ -872,14 +940,28 @@

    Instance Method Summary

  • - #sinter(*keys) + #sinter(keys : Array(String)) : Array(RedisValue)

    Returns the members of the set resulting from the intersection of all the given sets.

  • - #sinterstore(destination_key, *keys) + #sinter(*keys : String) : Array(RedisValue) + +

    Returns the members of the set resulting from the intersection of all the given sets.

    + +
  • + +
  • + #sinterstore(destination_key, *keys : String) : Int64 + +

    This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

    + +
  • + +
  • + #sinterstore(destination_key, keys : Array(String)) : Int64

    This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

    @@ -953,6 +1035,20 @@

    Instance Method Summary

  • +
  • + #subscribe(channels : Array(String)) : Void + +

    Subscribes to more channels while already being in a subscription loop.

    + +
  • + +
  • + #subscribe(*channels : String) + +

    Subscribes to more channels while already being in a subscription loop.

    + +
  • +
  • #subscribe(*channels, &callback_setup_block : Subscription -> ) @@ -961,21 +1057,28 @@

    Instance Method Summary

  • - #subscribe(*channels) + #sunion(keys : Array(String)) -

    Subscribes to more channels while already being in a subscription loop.

    +

    Returns the members of the set resulting from the union of all the given sets.

  • - #sunion(*keys) + #sunion(*keys : String)

    Returns the members of the set resulting from the union of all the given sets.

  • - #sunionstore(destination, *keys) + #sunionstore(destination, keys : Array(String)) : Int64 + +

    This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

    + +
  • + +
  • + #sunionstore(destination, *keys : String) : Int64

    This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

    @@ -995,6 +1098,13 @@

    Instance Method Summary

  • +
  • + #unsubscribe(channels : Array(String)) : Nil + +

    Unsubscribes the client from the given channels, or from all of them if none is given.

    + +
  • +
  • #unsubscribe(*channels) @@ -1010,14 +1120,14 @@

    Instance Method Summary

  • - #watch(*keys) + #watch(keys : Array(String))

    Marks the given keys to be watched for conditional execution of a transaction.

  • - #zadd(key, scores_and_members : Array(RedisValue)) + #watch(*keys)
  • @@ -1028,6 +1138,11 @@

    Instance Method Summary

    +
  • + #zadd(key, scores_and_members : Array(RedisValue)) + +
  • +
  • #zcard(key) @@ -1205,7 +1320,7 @@

    Instance Method Detail


    @@ -1225,7 +1340,7 @@

    Instance Method Detail


    @@ -1254,17 +1369,17 @@

    Instance Method Detail


    -
    +
    - def bitop(operation, key, *keys) + def bitop(operation, key, *keys : String) : Int64 - # + #

    Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

    @@ -1278,7 +1393,31 @@

    Instance Method Detail


    - [View source] + [View source] + +
    +
    + +
    +
    + + def bitop(operation, key, keys : Array(String)) : Int64 + + # +
    + +

    Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

    + +

    Return value: Integer, the size of the string stored in the destination key, that is equal to the size of the longest input string.

    + +

    Example:

    + +
    redis.bitop("and", "dest", "key1", "key2")
    + +
    +
    + + [View source]
    @@ -1307,7 +1446,7 @@

    Instance Method Detail


    @@ -1339,7 +1478,7 @@

    Instance Method Detail


    @@ -1372,7 +1511,7 @@

    Instance Method Detail


    @@ -1404,7 +1543,7 @@

    Instance Method Detail


    @@ -1424,7 +1563,7 @@

    Instance Method Detail


    @@ -1444,7 +1583,7 @@

    Instance Method Detail


    @@ -1468,7 +1607,7 @@

    Instance Method Detail


    @@ -1492,7 +1631,7 @@

    Instance Method Detail


    @@ -1512,7 +1651,7 @@

    Instance Method Detail


    @@ -1534,7 +1673,7 @@

    Instance Method Detail


    @@ -1559,7 +1698,7 @@

    Instance Method Detail


    @@ -1580,7 +1719,7 @@

    Instance Method Detail


    @@ -1602,7 +1741,7 @@

    Instance Method Detail


    @@ -1628,7 +1767,7 @@

    Instance Method Detail


    @@ -1652,7 +1791,7 @@

    Instance Method Detail


    @@ -1672,7 +1811,7 @@

    Instance Method Detail


    @@ -1692,7 +1831,7 @@

    Instance Method Detail


    @@ -1717,7 +1856,7 @@

    Instance Method Detail


    @@ -1737,7 +1876,7 @@

    Instance Method Detail


    @@ -1761,7 +1900,7 @@

    Instance Method Detail


    @@ -1785,7 +1924,7 @@

    Instance Method Detail


    @@ -1806,7 +1945,7 @@

    Instance Method Detail


    @@ -1828,7 +1967,7 @@

    Instance Method Detail


    @@ -1852,7 +1991,7 @@

    Instance Method Detail


    @@ -1873,7 +2012,7 @@

    Instance Method Detail


    @@ -1897,7 +2036,7 @@

    Instance Method Detail


    @@ -1918,7 +2057,7 @@

    Instance Method Detail


    @@ -1938,7 +2077,7 @@

    Instance Method Detail


    @@ -1958,27 +2097,47 @@

    Instance Method Detail


    -
    +
    - def hmget(key, *fields) + def hmget(key, *fields : String) : Array(RedisValue) - # + #

    Returns the values associated with the specified fields in the hash stored at key.

    -

    Return value: Array(String), the list of values associated with the given fields, in the same order as they are requested.

    +

    Return value: Array(RedisValue), the list of values associated with the given fields, in the same order as they are requested.


    - [View source] + [View source] + +
    +
    + +
    +
    + + def hmget(key, fields : Array(String)) : Array(RedisValue) + + # +
    + +

    Returns the values associated with the specified fields in the hash stored at key.

    + +

    Return value: Array(RedisValue), the list of values associated with the given fields, in the same order as they are requested.

    + +
    +
    + + [View source]
    @@ -1998,7 +2157,7 @@

    Instance Method Detail


    @@ -2018,7 +2177,7 @@

    Instance Method Detail


    @@ -2044,7 +2203,7 @@

    Instance Method Detail


    @@ -2066,7 +2225,7 @@

    Instance Method Detail


    @@ -2086,7 +2245,7 @@

    Instance Method Detail


    @@ -2111,7 +2270,7 @@

    Instance Method Detail


    @@ -2135,7 +2294,7 @@

    Instance Method Detail


    @@ -2159,7 +2318,7 @@

    Instance Method Detail


    @@ -2179,7 +2338,7 @@

    Instance Method Detail


    @@ -2203,7 +2362,7 @@

    Instance Method Detail


    @@ -2223,7 +2382,7 @@

    Instance Method Detail


    @@ -2247,7 +2406,7 @@

    Instance Method Detail


    @@ -2267,7 +2426,7 @@

    Instance Method Detail


    @@ -2291,7 +2450,7 @@

    Instance Method Detail


    @@ -2311,7 +2470,7 @@

    Instance Method Detail


    @@ -2324,10 +2483,14 @@

    Instance Method Detail

    # +

    Insert all the specified values at the head of the list stored at key.

    + +

    Return value: Integer, the length of the list after the push operation.

    +
    @@ -2347,7 +2510,7 @@

    Instance Method Detail


    @@ -2371,7 +2534,7 @@

    Instance Method Detail


    @@ -2395,7 +2558,7 @@

    Instance Method Detail


    @@ -2415,7 +2578,7 @@

    Instance Method Detail


    @@ -2435,7 +2598,23 @@

    Instance Method Detail


    - [View source] + [View source] + +
    + + +
    +
    + + def mget(keys : Array(String)) : Array(RedisValue) + + # +
    + +
    +
    + + [View source]
    @@ -2462,23 +2641,7 @@

    Instance Method Detail


    - [View source] - -
    - - -
    -
    - - def mget(keys : Array) - - # -
    - -
    -
    @@ -2502,7 +2665,7 @@

    Instance Method Detail


    @@ -2529,7 +2692,7 @@

    Instance Method Detail


    @@ -2551,7 +2714,7 @@

    Instance Method Detail


    @@ -2574,7 +2737,7 @@

    Instance Method Detail


    @@ -2596,7 +2759,7 @@

    Instance Method Detail


    @@ -2620,7 +2783,7 @@

    Instance Method Detail


    @@ -2643,7 +2806,7 @@

    Instance Method Detail


    @@ -2666,17 +2829,17 @@

    Instance Method Detail


    -
    +
    - def pfadd(key, *values) + def pfadd(key, *values : String) : Int64 - # + #

    Adds all the element arguments to the HyperLogLog data structure stored at @@ -2691,17 +2854,42 @@

    Instance Method Detail


    -
    +
    - def pfcount(*keys) + def pfadd(key, values : Array(String)) : Int64 - # + # +
    + +

    Adds all the element arguments to the HyperLogLog data structure stored at +the variable name specified as first argument.

    + +

    Return value: Integer: 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.

    + +

    Example:

    + +
    redis.pfadd("hll", "a", "b", "c", "d", "e", "f", "g") # => 1
    + +
    +
    + + [View source] + +
    +
    + +
    +
    + + def pfcount(keys : Array(String)) : Int64 + + #

    When called with a single key, returns the approximated cardinality computed @@ -2714,29 +2902,70 @@

    Instance Method Detail


    -
    +
    - def pfmerge(*keys) + def pfcount(*keys : String) : Int64 - # + # +
    + +

    When called with a single key, returns the approximated cardinality computed +by the HyperLogLog data structure stored at the specified variable, +which is 0 if the variable does not exist.

    + +

    Return value: Integer, the approximated number of unique elements +observed via PFADD.

    + +
    +
    + + [View source] + +
    +
    + +
    +
    + + def pfmerge(keys : Array(String)) + + #

    Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the -source HyperLogLog structures.

    +source HyperLogLog structures.

    + +
    +
    + + [View source] + +
    +
    + +
    +
    + + def pfmerge(*keys : String) -

    Return value: "OK".

    + # +
    + +

    Merge multiple HyperLogLog values into an unique value that will +approximate the cardinality of the union of the observed Sets of the +source HyperLogLog structures.


    @@ -2758,7 +2987,7 @@

    Instance Method Detail


    @@ -2778,7 +3007,7 @@

    Instance Method Detail


    @@ -2791,12 +3020,28 @@

    Instance Method Detail

    #
    +
    +
    + + [View source] + +
    +
    + +
    +
    + + def psubscribe(channel_patterns : Array(String)) + + # +
    +

    Subscribes to more channel patterns while already being in a subscription loop.


    @@ -2819,7 +3064,7 @@

    Instance Method Detail


    @@ -2841,7 +3086,7 @@

    Instance Method Detail


    @@ -2865,7 +3110,7 @@

    Instance Method Detail


    @@ -2883,7 +3128,25 @@

    Instance Method Detail


    - [View source] + [View source] + +
    + + +
    +
    + + def punsubscribe(channel_patterns : Array(String)) + + # +
    + +

    Unsubscribes the client from the given patterns, or from all of them if none is given.

    + +
    +
    + + [View source]
    @@ -2903,7 +3166,7 @@

    Instance Method Detail


    @@ -2921,7 +3184,7 @@

    Instance Method Detail


    @@ -2945,7 +3208,7 @@

    Instance Method Detail


    @@ -2969,7 +3232,7 @@

    Instance Method Detail


    @@ -2989,7 +3252,7 @@

    Instance Method Detail


    @@ -3009,7 +3272,7 @@

    Instance Method Detail


    @@ -3030,17 +3293,41 @@

    Instance Method Detail


    - [View source] + [View source] + +
    + + +
    +
    + + def rpush(key, *values : String) + + # +
    + +

    Insert all the specified values at the tail of the list stored at key.

    + +

    Return value: Integer, the length of the list after the push operation.

    + +

    Example:

    + +
    redis.rpush("mylist", "1", "2", "3")
    + +
    +
    + + [View source]
    -
    +
    - def rpush(key, *values) + def rpush(key, values : Array(RedisValue)) - # + #

    Insert all the specified values at the tail of the list stored at key.

    @@ -3054,7 +3341,7 @@

    Instance Method Detail


    @@ -3074,7 +3361,7 @@

    Instance Method Detail


    @@ -3094,7 +3381,7 @@

    Instance Method Detail


    @@ -3110,7 +3397,7 @@

    Instance Method Detail


    @@ -3140,7 +3427,7 @@

    Instance Method Detail


    @@ -3158,7 +3445,7 @@

    Instance Method Detail


    @@ -3181,7 +3468,7 @@

    Instance Method Detail


    @@ -3201,7 +3488,7 @@

    Instance Method Detail


    @@ -3222,7 +3509,7 @@

    Instance Method Detail


    @@ -3247,17 +3534,17 @@

    Instance Method Detail


    -
    +
    - def sdiff(*keys) + def sdiff(keys : Array(String)) : Array(RedisValue) - # + #

    Returns the members of the set resulting from the difference between the first set and all the successive sets.

    @@ -3267,17 +3554,33 @@

    Instance Method Detail


    -
    +
    - def sdiffstore(destination, *keys) + def sdiff(*keys : String) : Array(RedisValue) - # + # +
    + +
    +
    + + [View source] + +
    +
    + +
    +
    + + def sdiffstore(destination, *keys : String) : Int64 + + #

    This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

    @@ -3287,7 +3590,27 @@

    Instance Method Detail


    - [View source] + [View source] + +
    +
    + +
    +
    + + def sdiffstore(destination, keys : Array(String)) : Int64 + + # +
    + +

    This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

    + +

    Return value: Integer, the number of elements in the resulting set.

    + +
    +
    + + [View source]
    @@ -3307,7 +3630,7 @@

    Instance Method Detail


    @@ -3338,7 +3661,7 @@

    Instance Method Detail


    @@ -3362,7 +3685,7 @@

    Instance Method Detail


    @@ -3386,7 +3709,7 @@

    Instance Method Detail


    @@ -3408,7 +3731,7 @@

    Instance Method Detail


    @@ -3432,17 +3755,37 @@

    Instance Method Detail


    - [View source] + [View source] + +
    + + +
    +
    + + def sinter(keys : Array(String)) : Array(RedisValue) + + # +
    + +

    Returns the members of the set resulting from the intersection of all the given sets.

    + +

    Return value: Array(String), an array with members of the resulting set.

    + +
    +
    + + [View source]
    -
    +
    - def sinter(*keys) + def sinter(*keys : String) : Array(RedisValue) - # + #

    Returns the members of the set resulting from the intersection of all the given sets.

    @@ -3452,17 +3795,17 @@

    Instance Method Detail


    -
    +
    - def sinterstore(destination_key, *keys) + def sinterstore(destination_key, *keys : String) : Int64 - # + #

    This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

    @@ -3476,7 +3819,31 @@

    Instance Method Detail


    - [View source] + [View source] + +
    +
    + +
    +
    + + def sinterstore(destination_key, keys : Array(String)) : Int64 + + # +
    + +

    This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

    + +

    Return value: Integer, the number of elements in the resulting set.

    + +

    Example:

    + +
    redis.sinterstore("destination", "key1", "key2")
    + +
    +
    + + [View source]
    @@ -3498,7 +3865,7 @@

    Instance Method Detail


    @@ -3518,7 +3885,7 @@

    Instance Method Detail


    @@ -3540,7 +3907,7 @@

    Instance Method Detail


    @@ -3569,7 +3936,7 @@

    Instance Method Detail


    @@ -3591,7 +3958,7 @@

    Instance Method Detail


    @@ -3617,7 +3984,7 @@

    Instance Method Detail


    @@ -3633,7 +4000,7 @@

    Instance Method Detail


    @@ -3657,7 +4024,7 @@

    Instance Method Detail


    @@ -3687,7 +4054,7 @@

    Instance Method Detail


    @@ -3707,7 +4074,43 @@

    Instance Method Detail


    - [View source] + [View source] + +
    + + +
    +
    + + def subscribe(channels : Array(String)) : Void + + # +
    + +

    Subscribes to more channels while already being in a subscription loop.

    + +
    +
    + + [View source] + +
    +
    + +
    +
    + + def subscribe(*channels : String) + + # +
    + +

    Subscribes to more channels while already being in a subscription loop.

    + +
    +
    + + [View source]
    @@ -3744,35 +4147,37 @@

    Instance Method Detail


    -
    +
    - def subscribe(*channels) + def sunion(keys : Array(String)) - # + #
    -

    Subscribes to more channels while already being in a subscription loop.

    +

    Returns the members of the set resulting from the union of all the given sets.

    + +

    Return value: Array(String), with members of the resulting set.


    -
    +
    - def sunion(*keys) + def sunion(*keys : String) - # + #

    Returns the members of the set resulting from the union of all the given sets.

    @@ -3782,17 +4187,17 @@

    Instance Method Detail


    -
    +
    - def sunionstore(destination, *keys) + def sunionstore(destination, keys : Array(String)) : Int64 - # + #

    This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

    @@ -3802,7 +4207,27 @@

    Instance Method Detail


    - [View source] + [View source] + +
    +
    + +
    +
    + + def sunionstore(destination, *keys : String) : Int64 + + # +
    + +

    This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

    + +

    Return value: Integer, the number of elements in the resulting set.

    + +
    +
    + + [View source]
    @@ -3823,7 +4248,7 @@

    Instance Method Detail


    @@ -3848,7 +4273,25 @@

    Instance Method Detail


    - [View source] + [View source] + +
    +
    + +
    +
    + + def unsubscribe(channels : Array(String)) : Nil + + # +
    + +

    Unsubscribes the client from the given channels, or from all of them if none is given.

    + +
    +
    + + [View source]
    @@ -3866,7 +4309,7 @@

    Instance Method Detail


    @@ -3886,17 +4329,17 @@

    Instance Method Detail


    -
    +
    - def watch(*keys) + def watch(keys : Array(String)) - # + #

    Marks the given keys to be watched for conditional execution of a transaction.

    @@ -3906,23 +4349,23 @@

    Instance Method Detail


    -
    +
    - def zadd(key, scores_and_members : Array(RedisValue)) + def watch(*keys) - # + #

    @@ -3947,7 +4390,23 @@

    Instance Method Detail


    - [View source] + [View source] + +
    +
    + +
    +
    + + def zadd(key, scores_and_members : Array(RedisValue)) + + # +
    + +
    +
    + + [View source]
    @@ -3967,7 +4426,7 @@

    Instance Method Detail


    @@ -3987,7 +4446,7 @@

    Instance Method Detail


    @@ -4007,7 +4466,7 @@

    Instance Method Detail


    @@ -4036,7 +4495,7 @@

    Instance Method Detail


    @@ -4056,7 +4515,7 @@

    Instance Method Detail


    @@ -4084,7 +4543,7 @@

    Instance Method Detail


    @@ -4110,7 +4569,7 @@

    Instance Method Detail


    @@ -4135,7 +4594,7 @@

    Instance Method Detail


    @@ -4157,7 +4616,7 @@

    Instance Method Detail


    @@ -4177,7 +4636,7 @@

    Instance Method Detail


    @@ -4200,7 +4659,7 @@

    Instance Method Detail


    @@ -4220,7 +4679,7 @@

    Instance Method Detail


    @@ -4241,7 +4700,7 @@

    Instance Method Detail


    @@ -4265,7 +4724,7 @@

    Instance Method Detail


    @@ -4291,7 +4750,7 @@

    Instance Method Detail


    @@ -4316,7 +4775,7 @@

    Instance Method Detail


    @@ -4339,7 +4798,7 @@

    Instance Method Detail


    @@ -4369,7 +4828,7 @@

    Instance Method Detail


    @@ -4389,7 +4848,7 @@

    Instance Method Detail


    @@ -4413,7 +4872,7 @@

    Instance Method Detail


    diff --git a/docs/Redis/ConnectionError.html b/docs/Redis/ConnectionError.html index aa1ca93..3e97058 100644 --- a/docs/Redis/ConnectionError.html +++ b/docs/Redis/ConnectionError.html @@ -159,7 +159,7 @@

    Direct Known Subclasses

    Defined in:

    - + redis/error.cr diff --git a/docs/Redis/ConnectionLostError.html b/docs/Redis/ConnectionLostError.html index 83c7231..7b086a4 100644 --- a/docs/Redis/ConnectionLostError.html +++ b/docs/Redis/ConnectionLostError.html @@ -150,7 +150,7 @@

    Overview

    Defined in:

    - + redis/error.cr diff --git a/docs/Redis/Error.html b/docs/Redis/Error.html index a6f6978..7f861c7 100644 --- a/docs/Redis/Error.html +++ b/docs/Redis/Error.html @@ -161,7 +161,7 @@

    Direct Known Subclasses

    Defined in:

    - + redis/error.cr diff --git a/docs/Redis/Future.html b/docs/Redis/Future.html index c715154..b4e6ffe 100644 --- a/docs/Redis/Future.html +++ b/docs/Redis/Future.html @@ -154,7 +154,7 @@

    Overview

    Defined in:

    - + redis/future.cr @@ -236,7 +236,7 @@

    Constructor Detail


    @@ -259,7 +259,7 @@

    Instance Method Detail


    @@ -275,7 +275,7 @@

    Instance Method Detail


    diff --git a/docs/Redis/PipelineApi.html b/docs/Redis/PipelineApi.html index e603855..b23fbc4 100644 --- a/docs/Redis/PipelineApi.html +++ b/docs/Redis/PipelineApi.html @@ -171,7 +171,7 @@

    Included Modules

    Defined in:

    - + redis/pipeline_api.cr @@ -291,8 +291,8 @@

    Instance methods inherited from module - bitop(operation, key, *keys) + + bitop(operation, key, *keys : String) : Int64
    bitop(operation, key, keys : Array(String)) : Int64
    bitop
    , @@ -436,8 +436,8 @@

    Instance methods inherited from module - hmget(key, *fields) + + hmget(key, *fields : String) : Array(RedisValue)
    hmget(key, fields : Array(String)) : Array(RedisValue)
    hmget
    , @@ -541,8 +541,8 @@

    Instance methods inherited from module - mget(*keys)
    mget(keys : Array)
    +
    + mget(keys : Array(String)) : Array(RedisValue)
    mget(*keys)
    mget
    , @@ -586,18 +586,18 @@

    Instance methods inherited from module - pfadd(key, *values) + + pfadd(key, *values : String) : Int64
    pfadd(key, values : Array(String)) : Int64
    pfadd
    , - - pfcount(*keys) + + pfcount(keys : Array(String)) : Int64
    pfcount(*keys : String) : Int64
    pfcount
    , - - pfmerge(*keys) + + pfmerge(keys : Array(String))
    pfmerge(*keys : String)
    pfmerge
    , @@ -612,7 +612,7 @@

    Instance methods inherited from module - psubscribe(*channel_patterns)
    psubscribe(*channel_patterns, &callback_setup_block : Subscription -> )
    + psubscribe(*channel_patterns)
    psubscribe(channel_patterns : Array(String))
    psubscribe(*channel_patterns, &callback_setup_block : Subscription -> )
    psubscribe
    , @@ -627,7 +627,7 @@

    Instance methods inherited from module - punsubscribe(*channel_patterns) + punsubscribe(*channel_patterns)
    punsubscribe(channel_patterns : Array(String))
    punsubscribe
    , @@ -666,8 +666,8 @@

    Instance methods inherited from module - rpush(key, *values) + + rpush(key, *values : String)
    rpush(key, values : Array(RedisValue))
    rpush
    , @@ -711,13 +711,13 @@

    Instance methods inherited from module - sdiff(*keys) + + sdiff(keys : Array(String)) : Array(RedisValue)
    sdiff(*keys : String) : Array(RedisValue)
    sdiff
    , - - sdiffstore(destination, *keys) + + sdiffstore(destination, *keys : String) : Int64
    sdiffstore(destination, keys : Array(String)) : Int64
    sdiffstore
    , @@ -751,13 +751,13 @@

    Instance methods inherited from module - sinter(*keys) + + sinter(keys : Array(String)) : Array(RedisValue)
    sinter(*keys : String) : Array(RedisValue)
    sinter
    , - - sinterstore(destination_key, *keys) + + sinterstore(destination_key, *keys : String) : Int64
    sinterstore(destination_key, keys : Array(String)) : Int64
    sinterstore
    , @@ -806,18 +806,18 @@

    Instance methods inherited from module - subscribe(*channels, &callback_setup_block : Subscription -> )
    subscribe(*channels)
    +
    + subscribe(channels : Array(String)) : Void
    subscribe(*channels : String)
    subscribe(*channels, &callback_setup_block : Subscription -> )
    subscribe
    , - - sunion(*keys) + + sunion(keys : Array(String))
    sunion(*keys : String)
    sunion
    , - - sunionstore(destination, *keys) + + sunionstore(destination, keys : Array(String)) : Int64
    sunionstore(destination, *keys : String) : Int64
    sunionstore
    , @@ -831,8 +831,8 @@

    Instance methods inherited from module - unsubscribe(*channels) + + unsubscribe(channels : Array(String)) : Nil
    unsubscribe(*channels)
    unsubscribe
    , @@ -841,13 +841,13 @@

    Instance methods inherited from module - watch(*keys) + + watch(keys : Array(String))
    watch(*keys)
    watch
    , - - zadd(key, scores_and_members : Array(RedisValue))
    zadd(key, *scores_and_members)
    +
    + zadd(key, *scores_and_members)
    zadd(key, scores_and_members : Array(RedisValue))
    zadd
    , @@ -996,7 +996,7 @@

    Constructor Detail


    diff --git a/docs/Redis/PoolTimeoutError.html b/docs/Redis/PoolTimeoutError.html index f0d6cbf..1012089 100644 --- a/docs/Redis/PoolTimeoutError.html +++ b/docs/Redis/PoolTimeoutError.html @@ -150,7 +150,7 @@

    Overview

    Defined in:

    - + redis/error.cr diff --git a/docs/Redis/PooledClient.html b/docs/Redis/PooledClient.html index b32170c..25512f7 100644 --- a/docs/Redis/PooledClient.html +++ b/docs/Redis/PooledClient.html @@ -163,7 +163,7 @@

    Overview

    Defined in:

    - + redis/pooled_client.cr @@ -268,7 +268,7 @@

    Constructor Detail


    @@ -294,7 +294,7 @@

    Instance Method Detail


    @@ -310,7 +310,7 @@

    Instance Method Detail


    @@ -326,7 +326,7 @@

    Instance Method Detail


    @@ -347,7 +347,7 @@

    Macro Detail


    diff --git a/docs/Redis/SocketWrapper.html b/docs/Redis/SocketWrapper.html index dc37d48..d273865 100644 --- a/docs/Redis/SocketWrapper.html +++ b/docs/Redis/SocketWrapper.html @@ -152,7 +152,7 @@

    Overview

    Defined in:

    - + redis/socket_wrapper.cr @@ -254,7 +254,7 @@

    Constructor Detail


    @@ -270,7 +270,7 @@

    Constructor Detail


    @@ -293,7 +293,7 @@

    Instance Method Detail


    @@ -314,7 +314,7 @@

    Macro Detail


    diff --git a/docs/Redis/Subscription.html b/docs/Redis/Subscription.html index af31d7a..0bb1fd1 100644 --- a/docs/Redis/Subscription.html +++ b/docs/Redis/Subscription.html @@ -153,7 +153,7 @@

    Overview

    Defined in:

    - + redis/subscription.cr @@ -263,7 +263,7 @@

    Instance Method Detail


    @@ -281,7 +281,7 @@

    Instance Method Detail


    @@ -299,7 +299,7 @@

    Instance Method Detail


    @@ -317,7 +317,7 @@

    Instance Method Detail


    @@ -335,7 +335,7 @@

    Instance Method Detail


    @@ -353,7 +353,7 @@

    Instance Method Detail


    diff --git a/docs/Redis/TransactionApi.html b/docs/Redis/TransactionApi.html index 9fa3746..43e7fa1 100644 --- a/docs/Redis/TransactionApi.html +++ b/docs/Redis/TransactionApi.html @@ -171,7 +171,7 @@

    Included Modules

    Defined in:

    - + redis/transaction_api.cr @@ -303,8 +303,8 @@

    Instance methods inherited from module - bitop(operation, key, *keys) + + bitop(operation, key, *keys : String) : Int64
    bitop(operation, key, keys : Array(String)) : Int64
    bitop
    , @@ -448,8 +448,8 @@

    Instance methods inherited from module - hmget(key, *fields) + + hmget(key, *fields : String) : Array(RedisValue)
    hmget(key, fields : Array(String)) : Array(RedisValue)
    hmget
    , @@ -553,8 +553,8 @@

    Instance methods inherited from module - mget(*keys)
    mget(keys : Array)
    +
    + mget(keys : Array(String)) : Array(RedisValue)
    mget(*keys)
    mget
    , @@ -598,18 +598,18 @@

    Instance methods inherited from module - pfadd(key, *values) + + pfadd(key, *values : String) : Int64
    pfadd(key, values : Array(String)) : Int64
    pfadd
    , - - pfcount(*keys) + + pfcount(keys : Array(String)) : Int64
    pfcount(*keys : String) : Int64
    pfcount
    , - - pfmerge(*keys) + + pfmerge(keys : Array(String))
    pfmerge(*keys : String)
    pfmerge
    , @@ -624,7 +624,7 @@

    Instance methods inherited from module - psubscribe(*channel_patterns)
    psubscribe(*channel_patterns, &callback_setup_block : Subscription -> )
    + psubscribe(*channel_patterns)
    psubscribe(channel_patterns : Array(String))
    psubscribe(*channel_patterns, &callback_setup_block : Subscription -> )
    psubscribe
    , @@ -639,7 +639,7 @@

    Instance methods inherited from module - punsubscribe(*channel_patterns) + punsubscribe(*channel_patterns)
    punsubscribe(channel_patterns : Array(String))
    punsubscribe
    , @@ -678,8 +678,8 @@

    Instance methods inherited from module - rpush(key, *values) + + rpush(key, *values : String)
    rpush(key, values : Array(RedisValue))
    rpush
    , @@ -723,13 +723,13 @@

    Instance methods inherited from module - sdiff(*keys) + + sdiff(keys : Array(String)) : Array(RedisValue)
    sdiff(*keys : String) : Array(RedisValue)
    sdiff
    , - - sdiffstore(destination, *keys) + + sdiffstore(destination, *keys : String) : Int64
    sdiffstore(destination, keys : Array(String)) : Int64
    sdiffstore
    , @@ -763,13 +763,13 @@

    Instance methods inherited from module - sinter(*keys) + + sinter(keys : Array(String)) : Array(RedisValue)
    sinter(*keys : String) : Array(RedisValue)
    sinter
    , - - sinterstore(destination_key, *keys) + + sinterstore(destination_key, *keys : String) : Int64
    sinterstore(destination_key, keys : Array(String)) : Int64
    sinterstore
    , @@ -818,18 +818,18 @@

    Instance methods inherited from module - subscribe(*channels, &callback_setup_block : Subscription -> )
    subscribe(*channels)
    +
    + subscribe(channels : Array(String)) : Void
    subscribe(*channels : String)
    subscribe(*channels, &callback_setup_block : Subscription -> )
    subscribe
    , - - sunion(*keys) + + sunion(keys : Array(String))
    sunion(*keys : String)
    sunion
    , - - sunionstore(destination, *keys) + + sunionstore(destination, keys : Array(String)) : Int64
    sunionstore(destination, *keys : String) : Int64
    sunionstore
    , @@ -843,8 +843,8 @@

    Instance methods inherited from module - unsubscribe(*channels) + + unsubscribe(channels : Array(String)) : Nil
    unsubscribe(*channels)
    unsubscribe
    , @@ -853,13 +853,13 @@

    Instance methods inherited from module - watch(*keys) + + watch(keys : Array(String))
    watch(*keys)
    watch
    , - - zadd(key, scores_and_members : Array(RedisValue))
    zadd(key, *scores_and_members)
    +
    + zadd(key, *scores_and_members)
    zadd(key, scores_and_members : Array(RedisValue))
    zadd
    , @@ -1008,7 +1008,7 @@

    Constructor Detail


    @@ -1040,7 +1040,7 @@

    Instance Method Detail


    diff --git a/docs/index.html b/docs/index.html index b7e57b8..cd25005 100644 --- a/docs/index.html +++ b/docs/index.html @@ -135,7 +135,7 @@

    Installation

    dependencies:
       redis:
         github: stefanwille/crystal-redis
    -    version: ~> 2.2.1
    + version: ~> 2.3.0

    and then install the library into your project:

    diff --git a/docs/index.json b/docs/index.json index 99486a7..e80285b 100644 --- a/docs/index.json +++ b/docs/index.json @@ -1 +1 @@ -{"repository_name":"github.com/stefanwille/crystal-redis","body":"# Redis Client for Crystal\n\n[![Build Status](https://img.shields.io/travis/stefanwille/crystal-redis/master.svg?style=flat)](https://travis-ci.org/stefanwille/crystal-redis) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests)\n\nA Redis client for the Crystal programming language.\n\n## Features\n\n- Performance (> 680,000 commands per second using pipeline on a MacBook Air with a single client thread)\n- Pipelining\n- Transactions\n- LUA Scripting\n- All string commands\n- All hash commands\n- All list commands\n- All set commands\n- All hyperloglog commands\n- All commands for bit operations\n- All sorted set commands\n- Publish/subscribe\n\n## Installation\n\nAdd it to your `shard.yml`:\n\n```crystal\ndependencies:\n redis:\n github: stefanwille/crystal-redis\n version: ~> 2.2.1\n```\n\nand then install the library into your project:\n\n```bash\n$ shards install\n```\n\n### Installation on MacOS X\n\nOn MacOS X you may get this error:\n\n```\nld: library not found for -lssl (this usually means you need to install the development package for libssl)\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\n...\n```\n\nOr this warning:\n\n```\nPackage libssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libssl.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'libssl' found\nPackage libcrypto was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libcrypto.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'libcrypto' found\n```\n\nThe problem is that Crystal can't find openssl, because it is not installed by default on MacOS X.\n\nThe fix:\n\n1. Install openssl via [Homebrew](https://brew.sh/):\n\n```bash\n$ brew install openssl\n```\n\n2. Set the environment variable `PKG_CONFIG_PATH`:\n\n```bash\n$ export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig\n```\n\nNote: Please write me if you know a better way!\n\n## Required Crystal Version\n\nThis library needs Crystal version >= 0.25.0\n\nI haven't tested older Crystal versions.\n\n## Usage\n\nRequire the package:\n\n```crystal\n require \"redis\"\n```\n\nthen\n\n```crystal\n redis = Redis.new\n```\n\nThen you can call Redis commands on the `redis` object:\n\n```crystal\n redis.set(\"foo\", \"bar\")\n redis.get(\"foo\")\n```\n\n#### Connection Pooling\n\nSince version 2.0.0, a connection pool is built in. It is used implicitly through `Redis::PooledClient`:\n\n```Crystal\nredis = Redis::PooledClient.new\n10.times do |i|\n spawn do\n redis.set(\"foo#{i}\", \"bar\")\n redis.get(\"foo#{i}\") # => \"bar\"\n end\nend\n```\n\nThis `redis` instance can be shared across fibers, and accepts the same Redis commands as the `Redis` class.\nIt automatically allocates and frees connections from/to the pool, per command.\n\n## Examples\n\nTo get started, see the examples:\n\n- There is a separate git repository [crystal-redis-examples](https://github.com/stefanwille/crystal-redis-examples) with examples.\n- start with this [basic example](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/basic.cr)\n- look at [the other examples](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/)\n- the [spec](https://github.com/stefanwille/crystal-redis/blob/master/spec/redis_spec.cr) contains even more usage examples\n\n## Documentation\n\n- [API documentation](http://stefanwille.github.io/crystal-redis) -\n start reading it at the class `Redis`.\n- [Redis commands documentation](http://redis.io/commands) - the original Redis documentation is necessary, as the API documentation above is just a quick reference\n- [Redis documentation page](http://redis.io/documentation) - general information about Redis and its concepts\n\n## Performance\n\nI have benchmarked Crystal-Redis against several other client libraries in various programming languages in this [blog article](http://www.stefanwille.com/2015/05/redis-clients-crystal-vs-ruby-vs-c-vs-go/).\n\nHere are some results:\n\n- Crystal: With this library I get > 680,000 commands per second using pipeline on a MacBook Air with a single client thread.\n\n- C: The equivalent program written in C with Hiredis gets me 340,000 commands per second.\n\n- Ruby: Ruby 2.2.1 with the [redis-rb](https://github.com/redis/redis-rb) and Hiredis driver handles 150,000 commands per second.\n\n[Read more results](http://www.stefanwille.com/2015/05/redis-clients-crystal-vs-ruby-vs-c-vs-go/) for Go, Java, Node.js.\n\n## Status\n\nI have exercised every API method in the spec and built some example programs. Some people report production usage.\n\nI took great care to make this library very usable with respect to API, reliability and documentation.\n\n## Development\n\nThis project requires a locally running redis server running on port 6379 and with a Unix socket located at /tmp/redis.sock. In Homebrew's default redis.config the Unix domain socket option is disabled. To enable, edit `/usr/local/etc/redis.conf` or whatever your `redis.conf` is and uncomment this line:\n\n```\n# unixsocket /tmp/redis.sock\n```\n\nso that it reads\n\n```\nunixsocket /tmp/redis.sock\n```\n\nThen you can run the specs via\n\n`$ crystal spec`\n\n[See more information](https://github.com/stefanwille/crystal-redis/blob/master/CONTRIBUTING.md).\n\n### WARNING\n\nRunning the spec will delete database number 0!\n\n## Questions, Bugs & Support\n\nIf you have questions or need help, please open a ticket in the [GitHub issue tracker](https://github.com/stefanwille/crystal-redis/issues). This way others can benefit from the discussion.\n","program":{"html_id":"github.com/stefanwille/crystal-redis/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"superclass":null,"ancestors":[],"locations":[],"repository_name":"github.com/stefanwille/crystal-redis","program":true,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":null,"doc":null,"summary":null,"class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis","path":"Redis.html","kind":"class","full_name":"Redis","name":"Redis","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/ValueOriented","kind":"module","full_name":"Redis::CommandExecution::ValueOriented","name":"ValueOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/commands.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr"},{"filename":"redis/command_execution/value_oriented.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/command_execution/value_oriented.cr"},{"filename":"redis.cr","line_number":37,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr"},{"filename":"redis/command_execution/future_oriented.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/command_execution/future_oriented.cr"},{"filename":"redis/strategy/base.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/strategy/base.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/ValueOriented","kind":"module","full_name":"Redis::CommandExecution::ValueOriented","name":"ValueOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":null,"doc":"The class is the main entry point for the Redis client.\n\n**How to use**:\n\nRequire the package:\n\n```crystal\nrequire \"redis\"\n```\n\nThen instantiate this client class:\n\n```crystal\nredis = Redis.new\n```\n\nThen you can call Redis commands on the `redis` object:\n\n```crystal\nredis.set(\"foo\", \"bar\")\nredis.get(\"foo\")\nredis.incr(\"visitors\")\n```\n\nSee the mixin module [Commands](Redis/Commands.html) for most\nof the available Redis commands such as #incr, #rename, and so on.\n\n**Multithreading / Coroutines**\n\nPlease mind that a Redis object can't be shared across multiple threads/coroutines!\nEach thread/coroutine that wants to talk to Redis needs its own Redis object instance.","summary":"

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

    ","class_methods":[{"id":"open(host="localhost",port=6379,unixsocket=nil,password=nil,database=nil,url=nil,ssl=false,ssl_context=nil,dns_timeout=nil,connect_timeout=nil,reconnect=true,command_timeout=nil,&block)-class-method","html_id":"open(host="localhost",port=6379,unixsocket=nil,password=nil,database=nil,url=nil,ssl=false,ssl_context=nil,dns_timeout=nil,connect_timeout=nil,reconnect=true,command_timeout=nil,&block)-class-method","name":"open","doc":"Opens a Redis connection, yields the given block with a Redis object and closes the connection.\n\n**Options**:\n* host - the host to connect to\n* port - the port to connect to\n* unixsocket - instead of using TCP, you can connect to Redis via a Unix domain socket by passing its path here (e.g. \"/tmp/redis.sock\")\n* password - the password for authentication against the server. This is a convenience which saves you the extra call to the Redis `auth` command.\n* database - the number of the database to select. This a convenience which saves you a call a call to `#select`.\n* ssl - whether SSL should be enabled.\n* ssl_context - a OpenSSL::SSL::Context::Client.\n* dns_timeout - the dns timeout.\n* connect_timeout - the connect timeout.\n* command_timeout - the command timeout - applies when a command takes too long because the Redis-server is blocked by another command or by a dump.\n* reconnect - whether we should reconnect when we encounter a disconnected Redis connection.\n* url - Redis url. If this is given, it overrides all others.\n\nExample:\n\n```\nRedis.open do |redis|\n redis.incr(\"counter\")\nend\n```","summary":"

    Opens a Redis connection, yields the given block with a Redis object and closes the connection.

    ","abstract":false,"args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":""},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":""},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":""},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":""},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":""},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":""},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":""}],"args_string":"(host = "localhost", port = 6379, unixsocket = nil, password = nil, database = nil, url = nil, ssl = false, ssl_context = nil, dns_timeout = nil, connect_timeout = nil, reconnect = true, command_timeout = nil, &block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L193","def":{"name":"open","args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":""},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":""},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":""},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":""},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":""},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":""},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":""}],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"redis = Redis.new(host, port, unixsocket, password, database, url, ssl, ssl_context, dns_timeout, connect_timeout, reconnect, command_timeout)\nbegin\n yield redis\nensure\n redis.close\nend\n"}}],"constructors":[{"id":"new(host="localhost",port=6379,unixsocket:String?=nil,password:String?=nil,database:Int32?=nil,url=nil,ssl=false,ssl_context:OpenSSL::SSL::Context::Client?=nil,dns_timeout:Time::Span?=nil,connect_timeout:Time::Span?=nil,reconnect=true,command_timeout:Time::Span?=nil)-class-method","html_id":"new(host="localhost",port=6379,unixsocket:String?=nil,password:String?=nil,database:Int32?=nil,url=nil,ssl=false,ssl_context:OpenSSL::SSL::Context::Client?=nil,dns_timeout:Time::Span?=nil,connect_timeout:Time::Span?=nil,reconnect=true,command_timeout:Time::Span?=nil)-class-method","name":"new","doc":"Opens a Redis connection\n\n**Options**:\n* host - the host to connect to\n* port - the port to connect to\n* unixsocket - instead of using TCP, you can connect to Redis via a Unix domain socket by passing its path here (e.g. \"/tmp/redis.sock\")\n* password - the password for authentication against the server. This is a convenience which saves you the extra call to the Redis `auth` command.\n* database - the number of the database to select. This a convenience which saves you a call a call to `#select`.\n* ssl - whether SSL should be enabled.\n* ssl_context - a OpenSSL::SSL::Context::Client.\n* dns_timeout - the dns timeout.\n* connect_timeout - the connect timeout.\n* command_timeout - the command timeout - applies when a command takes too long because the Redis-server is blocked by another command or by a dump.\n* reconnect - whether we should reconnect when we encounter a disconnected Redis connection.\n* url - Redis url. If this is given, it overrides all others.\n\nExample:\n\n```\nredis = Redis.new\nredis.incr(\"counter\")\nredis.close\n```\n\nExample:\n\n```\nredis = Redis.new(host: \"localhost\", port: 6379)\n...\n```\n\nExample:\n\n```\nredis = Redis.new(unixsocket: \"/tmp/redis.sock\")\n...\n```\n\nExample:\n\n```\nredis = Redis.new(url: \"redis://:my-secret-pw@my.redis.com:6380/my-database\")\n...\n```","summary":"

    Opens a Redis connection

    ","abstract":false,"args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":"String | ::Nil"},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":"Int32 | ::Nil"},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":"OpenSSL::SSL::Context::Client | ::Nil"},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":"Time::Span | ::Nil"},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":"Time::Span | ::Nil"},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":"Time::Span | ::Nil"}],"args_string":"(host = "localhost", port = 6379, unixsocket : String? = nil, password : String? = nil, database : Int32? = nil, url = nil, ssl = false, ssl_context : OpenSSL::SSL::Context::Client? = nil, dns_timeout : Time::Span? = nil, connect_timeout : Time::Span? = nil, reconnect = true, command_timeout : Time::Span? = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L95","def":{"name":"new","args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":"String | ::Nil"},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":"Int32 | ::Nil"},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":"OpenSSL::SSL::Context::Client | ::Nil"},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":"Time::Span | ::Nil"},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":"Time::Span | ::Nil"},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":"Time::Span | ::Nil"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(host, port, unixsocket, password, database, url, ssl, ssl_context, dns_timeout, connect_timeout, reconnect, command_timeout)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"close-instance-method","html_id":"close-instance-method","name":"close","doc":"Closes the Redis connection.","summary":"

    Closes the Redis connection.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L205","def":{"name":"close","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@connection.try(&.close)\n@connection = nil\n@strategy = nil\n"}},{"id":"multi(&block)-instance-method","html_id":"multi(&block)-instance-method","name":"multi","doc":"Sends Redis commands in transaction mode.\n\nYields its block. The block receives as argument\nan object that has the same API as this class, except:\n * it participates in the transaction\n * all the Redis commands return Futures\n * there is an additional method #discard that will abort the transaction.\n\n**Return value**: an array with all the responses\n- one element for each executed command.\n\nExample:\n\n```\nredis.multi do |multi|\n multi.set(\"foo1\", \"first\")\n multi.set(\"foo2\", \"second\")\nend\n```\n\nSee the [examples repository](https://github.com/stefanwille/crystal-redis-examples) for more examples.","summary":"

    Sends Redis commands in transaction mode.

    ","abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L284","def":{"name":"multi","args":[],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n @strategy = Redis::Strategy::PauseDuringTransaction.new\n transaction_strategy = Redis::Strategy::Transaction.new(connection)\n transaction_strategy.begin\n transaction_api = Redis::TransactionApi.new(transaction_strategy)\n yield transaction_api\n transaction_strategy.commit.as(Array(RedisValue))\nrescue ex : Redis::ConnectionError | Redis::CommandTimeoutError\n close\n raise(ex)\nensure\n if @connection\n @strategy = Redis::Strategy::SingleStatement.new(@connection.not_nil!)\n end\nend"}},{"id":"pipelined(&block)-instance-method","html_id":"pipelined(&block)-instance-method","name":"pipelined","doc":"Sends Redis commands in pipeline mode.\n\nYields its block. The block receives as argument\nan object that has the same API as this class, except\nit participates in pipelining and all Redis commands return Futures.\n\n**Return value**: an array with all the responses\n- one element for each executed command.\n\nExample:\n\n```\nredis.pipelined do |pipeline|\n pipeline.set(\"foo1\", \"first\")\n pipeline.set(\"foo2\", \"second\")\nend\n```\n\nSee the [examples repository](https://github.com/stefanwille/crystal-redis-examples) for more examples.","summary":"

    Sends Redis commands in pipeline mode.

    ","abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L248","def":{"name":"pipelined","args":[],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n @strategy = Redis::Strategy::PauseDuringPipeline.new\n pipeline_strategy = Redis::Strategy::Pipeline.new(connection)\n pipeline_api = Redis::PipelineApi.new(pipeline_strategy)\n yield pipeline_api\n pipeline_strategy.commit.as(Array(RedisValue))\nrescue ex : Redis::ConnectionError | Redis::CommandTimeoutError\n close\n raise(ex)\nensure\n if @connection\n @strategy = Redis::Strategy::SingleStatement.new(@connection.not_nil!)\n end\nend"}},{"id":"url-instance-method","html_id":"url-instance-method","name":"url","doc":"Returns the server URL for this client.","summary":"

    Returns the server URL for this client.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L212","def":{"name":"url","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"scheme = @ssl ? \"rediss\" : \"redis\"\nif @unixsocket\n \"#{scheme}://#{@unixsocket}/#{@database || 0}\"\nelse\n \"#{scheme}://#{@host}:#{@port}/#{@database || 0}\"\nend\n"}}],"macros":[],"types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CannotConnectError","path":"Redis/CannotConnectError.html","kind":"class","full_name":"Redis::CannotConnectError","name":"CannotConnectError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":10,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when connecting to the Redis server is not possible.","summary":"

    Raised when connecting to the Redis server is not possible.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","path":"Redis/Commands.html","kind":"module","full_name":"Redis::Commands","name":"Commands","abstract":false,"superclass":null,"ancestors":[],"locations":[{"filename":"redis/commands.cr","line_number":4,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PipelineApi","kind":"class","full_name":"Redis::PipelineApi","name":"PipelineApi"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/TransactionApi","kind":"class","full_name":"Redis::TransactionApi","name":"TransactionApi"}],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Definition of all Redis commands except pipelining and transactions.\n","summary":"

    Definition of all Redis commands except pipelining and transactions.

    ","class_methods":[],"constructors":[],"instance_methods":[{"id":"append(key,value)-instance-method","html_id":"append(key,value)-instance-method","name":"append","doc":"If key already exists and is a string, this command appends the value at the end of the string.\nIf key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.\n\n**Return value**: Integer, the length of the string after the append operation.\n\nExample:\n\n```\nredis.append(\"foo\", \" world\")\n```","summary":"

    If key already exists and is a string, this command appends the value at the end of the string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L366","def":{"name":"append","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"APPEND\", key.to_s, value.to_s])"}},{"id":"auth(password)-instance-method","html_id":"auth(password)-instance-method","name":"auth","doc":"Request for authentication in a password-protected Redis server.\n\n**Return value**: \"OK\"","summary":"

    Request for authentication in a password-protected Redis server.

    ","abstract":false,"args":[{"name":"password","doc":null,"default_value":"","external_name":"password","restriction":""}],"args_string":"(password)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L87","def":{"name":"auth","args":[{"name":"password","doc":null,"default_value":"","external_name":"password","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"AUTH\", password])"}},{"id":"bitcount(key,from=nil,to=nil)-instance-method","html_id":"bitcount(key,from=nil,to=nil)-instance-method","name":"bitcount","doc":"Count the number of set bits (population counting) in a string.\nBy default all the bytes contained in the string are examined.\n\n**Options**:\n\n* from / to - It is possible to specify the counting operation only in an interval passing the additional arguments from and to.\n\n**Return value** Integer, the number of bits set to 1.\n\nExample:\n\n```\nredis.bitcount(\"foo\", 0, 0)\n```","summary":"

    Count the number of set bits (population counting) in a string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"nil","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"args_string":"(key, from = nil, to = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L418","def":{"name":"bitcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"nil","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BITCOUNT\", key.to_s]\nif from\n if to\n q << from.to_s\n q << to.to_s\n else\n raise(Redis::Error.new(\"from specified, but not to\"))\n end\nend\ninteger_command(q)\n"}},{"id":"bitop(operation,key,*keys)-instance-method","html_id":"bitop(operation,key,*keys)-instance-method","name":"bitop","doc":"Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.\n\n**Return value**: Integer, the size of the string stored in the destination key, that is equal to the size of the longest input string.\n\nExample:\n\n```\nredis.bitop(\"and\", \"dest\", \"key1\", \"key2\")\n```","summary":"

    Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

    ","abstract":false,"args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(operation, key, *keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L440","def":{"name":"bitop","args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":2,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"BITOP\", operation.to_s, key.to_s], keys))"}},{"id":"bitpos(key,bit,start=nil,to=nil)-instance-method","html_id":"bitpos(key,bit,start=nil,to=nil)-instance-method","name":"bitpos","doc":"Return the position of the first bit set to 1 or 0 in a string.\n\n**Options**:\n\n* start / to - By default, all the bytes contained in the string are examined. It is possible to look for bits only in a specified interval passing the additional arguments start and to (it is possible to just pass start, the operation will assume that the to is the last byte of the string.\n\n**Return value**: Integer, the command returns the position of the first bit set to 1 or 0 according to the request.\n\nExample:\n\n```\nredis.set(\"mykey\", \"0\")\nredis.bitpos(\"mykey\", 1) # => 2\n```","summary":"

    Return the position of the first bit set to 1 or 0 in a string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"bit","doc":null,"default_value":"","external_name":"bit","restriction":""},{"name":"start","doc":null,"default_value":"nil","external_name":"start","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"args_string":"(key, bit, start = nil, to = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L478","def":{"name":"bitpos","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"bit","doc":null,"default_value":"","external_name":"bit","restriction":""},{"name":"start","doc":null,"default_value":"nil","external_name":"start","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BITPOS\", key.to_s, bit.to_s] of RedisValue\nif start\n q << start.to_s\n if to\n q << to\n end\nend\ninteger_command(q)\n"}},{"id":"blpop(keys,timeout_in_seconds)-instance-method","html_id":"blpop(keys,timeout_in_seconds)-instance-method","name":"blpop","doc":"BLPOP is a blocking list pop primitive.\nIt is the blocking version of LPOP because it blocks the connection when there\nare no elements to pop from any of the given lists.\nAn element is popped from the head of the first list that is non-empty,\nwith the given keys being checked in the order that they are given.\n\nThe timeout_in_seconds argument is interpreted as an integer value specifying the maximum number of seconds to block\n\n**Return value**: Array, specifically:\n* An array of nils when no element could be popped and the timeout expired.\n* An array of two-element arrays with the first element being the name of the key where an element was popped and the second element being the value of the popped element.\n\nExample:\n\n```\nredis.blpop([\"myotherlist\", \"mylist\"], 1) # => [\"mylist\", \"hello\"]\n```","summary":"

    BLPOP is a blocking list pop primitive.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(keys, timeout_in_seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L857","def":{"name":"blpop","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = concat([\"BLPOP\"], keys)\nq << timeout_in_seconds.to_s\narray_or_nil_command(q)\n"}},{"id":"brpop(keys,timeout_in_seconds)-instance-method","html_id":"brpop(keys,timeout_in_seconds)-instance-method","name":"brpop","doc":"BRPOP is a blocking list pop primitive.\nIt is the blocking version of RPOP because it blocks the connection when there\nare no elements to pop from any of the given lists.\nAn element is popped from the tail of the first list that is non-empty,\nwith the given keys being checked in the order that they are given.\n\nThe timeout_in_seconds argument is interpreted as an integer value specifying the maximum\nnumber of seconds to block.\n\n**Return value**: Array, specifically:\n* An array of nils when no element could be popped and the timeout expired.\n* An array of two-element arrays with the first element being the name of the key where an element was popped and the second element being the value of the popped element.\n\nExample:\n\n```\nredis.brpop([\"myotherlist\", \"mylist\"], 1) # => [\"mylist\", \"world\"]\n```","summary":"

    BRPOP is a blocking list pop primitive.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(keys, timeout_in_seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L881","def":{"name":"brpop","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = concat([\"BRPOP\"], keys)\nq << timeout_in_seconds.to_s\narray_or_nil_command(q)\n"}},{"id":"brpoplpush(source,destination,timeout_in_seconds=nil)-instance-method","html_id":"brpoplpush(source,destination,timeout_in_seconds=nil)-instance-method","name":"brpoplpush","doc":"BRPOPLPUSH is the blocking variant of RPOPLPUSH.\nWhen source contains elements, this command behaves exactly like RPOPLPUSH.\n\n**Options**:\n\n* timeout_in_seconds - interpreted as an integer value specifying the maximum number of seconds to block\n\nSee RPOPLPUSH for more information.\n\n**Return value**: String, the element being popped from source and pushed to destination.\nIf timeout is reached, nil is returned.\n\nExample:\n\n```\nredis.brpoplpush(\"source\", \"destination\", 0)\n```","summary":"

    BRPOPLPUSH is the blocking variant of RPOPLPUSH.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"nil","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(source, destination, timeout_in_seconds = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L912","def":{"name":"brpoplpush","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"nil","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BRPOPLPUSH\", source.to_s, destination.to_s]\nif timeout_in_seconds\n q << timeout_in_seconds.to_s\nend\nstring_or_nil_command(q)\n"}},{"id":"decr(key)-instance-method","html_id":"decr(key)-instance-method","name":"decr","doc":"Decrements the number stored at key by one.\n\n**Return value**: Integer, the value of key after the decrement","summary":"

    Decrements the number stored at key by one.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L319","def":{"name":"decr","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"DECR\", key.to_s])"}},{"id":"decrby(key,decrement)-instance-method","html_id":"decrby(key,decrement)-instance-method","name":"decrby","doc":"Decrements the number stored at key by decrement.\n\n**Return value**: Integer, the value of key after the decrement","summary":"

    Decrements the number stored at key by decrement.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"decrement","doc":null,"default_value":"","external_name":"decrement","restriction":""}],"args_string":"(key, decrement)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L352","def":{"name":"decrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"decrement","doc":null,"default_value":"","external_name":"decrement","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"DECRBY\", key.to_s, decrement.to_s])"}},{"id":"del(keys:Array)-instance-method","html_id":"del(keys:Array)-instance-method","name":"del","doc":"Removes the specified keys.\n\n**Return value**: Integer, the number of keys that were removed.\n\nExample:\n\n```\nredis.del([\"some\", \"keys\", \"to\", \"delete\"])\n```","summary":"

    Removes the specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"args_string":"(keys : Array)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L146","def":{"name":"del","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"DEL\"], keys))"}},{"id":"del(*keys)-instance-method","html_id":"del(*keys)-instance-method","name":"del","doc":"Removes the specified keys.\n\n**Return value**: Integer, the number of keys that were removed.\n\nExample:\n\n```\nredis.del(\"some\", \"keys\", \"to\", \"delete\")\n```","summary":"

    Removes the specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L133","def":{"name":"del","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"DEL\"], keys))"}},{"id":"dump(key)-instance-method","html_id":"dump(key)-instance-method","name":"dump","doc":"Serialize the value stored at key in a Redis-specific format and return it to the user.\n\n**Return value**: String, the serialized value.","summary":"

    Serialize the value stored at key in a Redis-specific format and return it to the user.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L492","def":{"name":"dump","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"DUMP\", key.to_s])"}},{"id":"echo(message)-instance-method","html_id":"echo(message)-instance-method","name":"echo","doc":"Returns the given message.\n\nExample:\n\n```\nredis.echo(\"Hello Redis\") # => \"Hello Redis\"\n```","summary":"

    Returns the given message.

    ","abstract":false,"args":[{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"args_string":"(message)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L12","def":{"name":"echo","args":[{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"ECHO\", message.to_s])"}},{"id":"eval(script:String,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","html_id":"eval(script:String,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","name":"eval","doc":"EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter\nbuilt into Redis starting from version 2.6.0.\n\n**Return value**: Array(String), depends on the executed script\n\nExample:\n\n```\nredis.eval(\"return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}\", [\"key1\", \"key2\"], [\"first art\", \"second arg\"])\n```","summary":"

    EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.

    ","abstract":false,"args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"args_string":"(script : String, keys = [] of RedisValue, args = [] of RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1399","def":{"name":"eval","args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"EVAL\", script, keys.size.to_s], keys, args))"}},{"id":"evalsha(sha1,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","html_id":"evalsha(sha1,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","name":"evalsha","doc":"EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter\nbuilt into Redis starting from version 2.6.0.\n\n**Return value**: Array(String), depends on the executed script","summary":"

    EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.

    ","abstract":false,"args":[{"name":"sha1","doc":null,"default_value":"","external_name":"sha1","restriction":""},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"args_string":"(sha1, keys = [] of RedisValue, args = [] of RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1407","def":{"name":"evalsha","args":[{"name":"sha1","doc":null,"default_value":"","external_name":"sha1","restriction":""},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"EVALSHA\", sha1.to_s, keys.size.to_s], keys, args))"}},{"id":"exists(key)-instance-method","html_id":"exists(key)-instance-method","name":"exists","doc":"Returns if key exists.\n\n**Return value**:\n* 1 if the key exists.\n* 0 if the key does not exist.","summary":"

    Returns if key exists.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L540","def":{"name":"exists","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXISTS\", key.to_s])"}},{"id":"expire(key,seconds)-instance-method","html_id":"expire(key,seconds)-instance-method","name":"expire","doc":"Set a timeout on key.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.\n\nExample:\n\n```\nredis.expire(\"temp\", 2)\n```","summary":"

    Set a timeout on key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"seconds","doc":null,"default_value":"","external_name":"seconds","restriction":""}],"args_string":"(key, seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1475","def":{"name":"expire","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"seconds","doc":null,"default_value":"","external_name":"seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXPIRE\", key.to_s, seconds.to_s])"}},{"id":"expireat(key,unix_date)-instance-method","html_id":"expireat(key,unix_date)-instance-method","name":"expireat","doc":"EXPIREAT has the same effect and semantic as EXPIRE, but instead of\nspecifying the number of seconds representing the TTL (time to live),\nit takes an absolute Unix timestamp (seconds since January 1, 1970).\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date","doc":null,"default_value":"","external_name":"unix_date","restriction":""}],"args_string":"(key, unix_date)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1496","def":{"name":"expireat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date","doc":null,"default_value":"","external_name":"unix_date","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXPIREAT\", key.to_s, unix_date.to_s])"}},{"id":"flushall-instance-method","html_id":"flushall-instance-method","name":"flushall","doc":"Flush all databases.\n\n**Return value**: \"OK\"","summary":"

    Flush all databases.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1453","def":{"name":"flushall","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"FLUSHALL\"])"}},{"id":"flushdb-instance-method","html_id":"flushdb-instance-method","name":"flushdb","doc":"Flush the current database.\n\n**Return value**: \"OK\"","summary":"

    Flush the current database.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1446","def":{"name":"flushdb","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"FLUSHDB\"])"}},{"id":"get(key)-instance-method","html_id":"get(key)-instance-method","name":"get","doc":"Get the value of key.\n\n**Return value**: a String or nil\n\nExample:\n\n```\nredis.set(\"foo\", \"test\")\nredis.get(\"foo\") # => \"test\"\n```","summary":"

    Get the value of key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L66","def":{"name":"get","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"GET\", key.to_s])"}},{"id":"getbit(key,index)-instance-method","html_id":"getbit(key,index)-instance-method","name":"getbit","doc":"Returns the bit value at offset in the string value stored at key.\n\n**Return value**: Integer, the bit value stored at offset.","summary":"

    Returns the bit value at offset in the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"args_string":"(key, index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L447","def":{"name":"getbit","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"GETBIT\", key.to_s, index.to_s])"}},{"id":"getrange(key,start_index,end_index)-instance-method","html_id":"getrange(key,start_index,end_index)-instance-method","name":"getrange","doc":"Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).\n\n\nExample:\n\n```\nredis.set(\"foo\", \"This is a string\")\nredis.getrange(\"foo\", 0, 3) # => \"This\"\nredis.getrange(\"foo\", -3, -1) # => \"ing\"\n```","summary":"

    Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"end_index","doc":null,"default_value":"","external_name":"end_index","restriction":""}],"args_string":"(key, start_index, end_index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L387","def":{"name":"getrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"end_index","doc":null,"default_value":"","external_name":"end_index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"GETRANGE\", key.to_s, start_index.to_s, end_index.to_s])"}},{"id":"getset(key,value)-instance-method","html_id":"getset(key,value)-instance-method","name":"getset","doc":"Atomically sets key to value and returns the old value stored at key.\n\n**Return value**: String, the old value stored at key, or nil when key did not exist.\n\nExample:\n\n```\nredis.getset(\"foo\", \"new\") # => (the old value)\n```","summary":"

    Atomically sets key to value and returns the old value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L251","def":{"name":"getset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"GETSET\", key.to_s, value])"}},{"id":"hdel(key,field)-instance-method","html_id":"hdel(key,field)-instance-method","name":"hdel","doc":"Removes the specified fields from the hash stored at key.\n\n**Return value**: Integer, the number of fields that were removed from the hash,\nnot including specified but non existing fields.","summary":"

    Removes the specified fields from the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L960","def":{"name":"hdel","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HDEL\", key.to_s, field.to_s])"}},{"id":"hexists(key,field)-instance-method","html_id":"hexists(key,field)-instance-method","name":"hexists","doc":"Returns if field is an existing field in the hash stored at key.\n\n**Return value**: Integer, specifically:\n* 1 if the hash contains field.\n* 0 if the hash does not contain field, or key does not exist.","summary":"

    Returns if field is an existing field in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L969","def":{"name":"hexists","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HEXISTS\", key.to_s, field.to_s])"}},{"id":"hget(key,field)-instance-method","html_id":"hget(key,field)-instance-method","name":"hget","doc":"Returns the value associated with field in the hash stored at key.\n\n**Return value**: String, the value associated with field, or nil\n\nExample:\n\n```\nredis.hget(\"myhash\", \"a\") # => \"434\"\n```","summary":"

    Returns the value associated with field in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L944","def":{"name":"hget","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"HGET\", key.to_s, field.to_s])"}},{"id":"hgetall(key)-instance-method","html_id":"hgetall(key)-instance-method","name":"hgetall","doc":"Returns all fields and values of the hash stored at key.\n\n**Return value**: Array(String) of fields and their values stored in the hash,\nor an empty array when key does not exist.","summary":"

    Returns all fields and values of the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L952","def":{"name":"hgetall","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HGETALL\", key.to_s])"}},{"id":"hincrby(key,field,increment)-instance-method","html_id":"hincrby(key,field,increment)-instance-method","name":"hincrby","doc":"Increments the number stored at field in the hash stored at key by increment.\n\n**Return value**: Integer, the value at field after the increment operation.\n\nExample:\n\n```\nredis.hincrby(\"myhash\", \"field1\", \"3\") # => 4\n```","summary":"

    Increments the number stored at field in the hash stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, field, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L982","def":{"name":"hincrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HINCRBY\", key.to_s, field.to_s, increment.to_s])"}},{"id":"hincrbyfloat(key,field,increment)-instance-method","html_id":"hincrbyfloat(key,field,increment)-instance-method","name":"hincrbyfloat","doc":"Increment the specified field of an hash stored at key,\nand representing a floating point number, by the specified increment.\n\n**Return value**: String, the value at field after the increment operation.","summary":"

    Increment the specified field of an hash stored at key, and representing a floating point number, by the specified increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, field, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L990","def":{"name":"hincrbyfloat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"HINCRBYFLOAT\", key.to_s, field.to_s, increment.to_s])"}},{"id":"hkeys(key)-instance-method","html_id":"hkeys(key)-instance-method","name":"hkeys","doc":"Returns all field names in the hash stored at key.\n\n**Return value**: Array(String) - list of fields in the hash, or an empty list when key does not exist.","summary":"

    Returns all field names in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L997","def":{"name":"hkeys","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HKEYS\", key.to_s])"}},{"id":"hlen(key)-instance-method","html_id":"hlen(key)-instance-method","name":"hlen","doc":"Returns the number of fields contained in the hash stored at key.\n\n**Return value**: Integer, the number of fields in the hash, or 0 when key does not exist.","summary":"

    Returns the number of fields contained in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1004","def":{"name":"hlen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HLEN\", key.to_s])"}},{"id":"hmget(key,*fields)-instance-method","html_id":"hmget(key,*fields)-instance-method","name":"hmget","doc":"Returns the values associated with the specified fields in the hash stored at key.\n\n**Return value**: Array(String), the list of values associated with the given fields, in the same order as they are requested.","summary":"

    Returns the values associated with the specified fields in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":""}],"args_string":"(key, *fields)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1011","def":{"name":"hmget","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"HMGET\", key.to_s], fields))"}},{"id":"hmset(key,hash)-instance-method","html_id":"hmset(key,hash)-instance-method","name":"hmset","doc":"Sets the specified fields to their respective values in the hash stored at key.\n\n**Return value**: \"OK\"","summary":"

    Sets the specified fields to their respective values in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"args_string":"(key, hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1018","def":{"name":"hmset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"HMSET\", key.to_s] of RedisValue\nhash.each do |field, value|\n (q << field.to_s) << value.to_s\nend\nstring_command(q)\n"}},{"id":"hscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"hscan(key,cursor,match=nil,count=nil)-instance-method","name":"hscan","doc":"```\nredis.hscan(\"myhash\", 0)\nredis.hscan(\"myhash\", 0, \"foo*\")\nredis.hscan(\"myhash\", 0, \"foo*\", 1024)\n```","summary":"

    ` redis.hscan(\"myhash\", 0) redis.hscan(\"myhash\", 0, \"foo\") redis.hscan(\"myhash\", 0, \"foo\", 1024) `

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1038","def":{"name":"hscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"HSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"hset(key,field,value)-instance-method","html_id":"hset(key,field,value)-instance-method","name":"hset","doc":"Sets field in the hash stored at key to value.\n\n**Return value**: Integer, specifically:\n* 1 if field is a new field in the hash and value was set.\n* 0 if field already exists in the hash and the value was updated.\n\nExample:\n\n```\nredis.hset(\"myhash\", \"a\", \"434\")\n```","summary":"

    Sets field in the hash stored at key to value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, field, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L931","def":{"name":"hset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HSET\", key.to_s, field.to_s, value.to_s])"}},{"id":"hsetnx(key,field,value)-instance-method","html_id":"hsetnx(key,field,value)-instance-method","name":"hsetnx","doc":"Sets field in the hash stored at key to value, only if field does not yet exist.\n\n**Return value**: Integer, specifically:\n* 1 if field is a new field in the hash and value was set.\n* 0 if field already exists in the hash and no operation was performed.","summary":"

    Sets field in the hash stored at key to value, only if field does not yet exist.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, field, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1050","def":{"name":"hsetnx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HSETNX\", key.to_s, field.to_s, value.to_s])"}},{"id":"hvals(key)-instance-method","html_id":"hvals(key)-instance-method","name":"hvals","doc":"Returns all values in the hash stored at key.\n\n**Return value**: Array(String), the list of values in the hash, or an empty list when key does not exist.","summary":"

    Returns all values in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1057","def":{"name":"hvals","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HVALS\", key.to_s])"}},{"id":"incr(key)-instance-method","html_id":"incr(key)-instance-method","name":"incr","doc":"Increments the number stored at key by one.\n\n**Return value**: Integer: the value of key after the increment\n\nExample:\n\n```\nredis.set(\"foo\", \"3\")\nredis.incr(\"foo\") # => 4\n```","summary":"

    Increments the number stored at key by one.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L312","def":{"name":"incr","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"INCR\", key.to_s])"}},{"id":"incrby(key,increment)-instance-method","html_id":"incrby(key,increment)-instance-method","name":"incrby","doc":"Increments the number stored at key by increment.\n\n**Return value**: Integer, the value of key after the increment\n\nExample:\n\n```\nredis.incrby(\"foo\", 4)\n```","summary":"

    Increments the number stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L332","def":{"name":"incrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"INCRBY\", key.to_s, increment.to_s])"}},{"id":"incrbyfloat(key,increment)-instance-method","html_id":"incrbyfloat(key,increment)-instance-method","name":"incrbyfloat","doc":"Increment the string representing a floating point number stored at key by the specified increment.\n\n**Return value**: Integer, the value of key after the increment\n\nExample:\n\n```\nredis.incrbyfloat(\"foo\", 2.5)\n```","summary":"

    Increment the string representing a floating point number stored at key by the specified increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L345","def":{"name":"incrbyfloat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"INCRBYFLOAT\", key.to_s, increment.to_s])"}},{"id":"info(section:String?=nil)-instance-method","html_id":"info(section:String?=nil)-instance-method","name":"info","doc":"The INFO command returns information and statistics about the server.\n\n**Return value**: A hash with the server information","summary":"

    The INFO command returns information and statistics about the server.

    ","abstract":false,"args":[{"name":"section","doc":null,"default_value":"nil","external_name":"section","restriction":"String | ::Nil"}],"args_string":"(section : String? = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1674","def":{"name":"info","args":[{"name":"section","doc":null,"default_value":"nil","external_name":"section","restriction":"String | ::Nil"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"arr = [\"INFO\"]\nif section\n arr << section\nend\nbulk = string_command(arr)\nresults = Hash(String, String).new\n(bulk.split(\"\\r\\n\")).each do |line|\n if line.empty? || (line[0] == '#')\n next\n end\n key, val = line.split(\":\")\n results[key] = val\nend\nresults\n"}},{"id":"keys(pattern)-instance-method","html_id":"keys(pattern)-instance-method","name":"keys","doc":"Returns all keys matching pattern.\n\n**Return value**: Array(String), array of keys matching pattern.\n\nExample:\n\n```\nredis.keys(\"callmemaybe\")\n```","summary":"

    Returns all keys matching pattern.

    ","abstract":false,"args":[{"name":"pattern","doc":null,"default_value":"","external_name":"pattern","restriction":""}],"args_string":"(pattern)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L553","def":{"name":"keys","args":[{"name":"pattern","doc":null,"default_value":"","external_name":"pattern","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"KEYS\", pattern.to_s])"}},{"id":"lindex(key,index)-instance-method","html_id":"lindex(key,index)-instance-method","name":"lindex","doc":"Returns the element at index index in the list stored at key.\n\n**Return value**: String, the requested element, or nil when index is out of range.","summary":"

    Returns the element at index index in the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"args_string":"(key, index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L618","def":{"name":"lindex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"LINDEX\", key.to_s, index.to_s])"}},{"id":"linsert(key,where,pivot,value)-instance-method","html_id":"linsert(key,where,pivot,value)-instance-method","name":"linsert","doc":"Inserts value in the list stored at key either before or after the reference value pivot.\n\n**Options**:\n\n* where - either \"BEFORE\" or \"AFTER\"\n\n**Return value**: Integer, the length of the list after the insert operation, or -1 when the value pivot was not found.","summary":"

    Inserts value in the list stored at key either before or after the reference value pivot.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"where","doc":null,"default_value":"","external_name":"where","restriction":""},{"name":"pivot","doc":null,"default_value":"","external_name":"pivot","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, where, pivot, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L656","def":{"name":"linsert","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"where","doc":null,"default_value":"","external_name":"where","restriction":""},{"name":"pivot","doc":null,"default_value":"","external_name":"pivot","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LINSERT\", key.to_s, where.to_s, pivot.to_s, value.to_s])"}},{"id":"llen(key)-instance-method","html_id":"llen(key)-instance-method","name":"llen","doc":"Returns the length of the list stored at key.\n\n**Return value**: Integer, the length of the list at key.","summary":"

    Returns the length of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L611","def":{"name":"llen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LLEN\", key.to_s])"}},{"id":"lpop(key)-instance-method","html_id":"lpop(key)-instance-method","name":"lpop","doc":"Removes and returns the first element of the list stored at key.\n\n**Return value**: String, the value of the first element, or nil when key does not exist.\n\nExample:\n\n```\nredis.lpop(\"mylist\")\n```","summary":"

    Removes and returns the first element of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L638","def":{"name":"lpop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"LPOP\", key.to_s])"}},{"id":"lpush(key,*values)-instance-method","html_id":"lpush(key,*values)-instance-method","name":"lpush","doc":"Insert all the specified values at the head of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Insert all the specified values at the head of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L573","def":{"name":"lpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"LPUSH\", key.to_s], values))"}},{"id":"lpush(key,values:Array(RedisValue))-instance-method","html_id":"lpush(key,values:Array(RedisValue))-instance-method","name":"lpush","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L577","def":{"name":"lpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"LPUSH\", key.to_s], values))"}},{"id":"lpushx(key,value)-instance-method","html_id":"lpushx(key,value)-instance-method","name":"lpushx","doc":"Inserts value at the head of the list stored at key, only if key already exists and holds a list.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Inserts value at the head of the list stored at key, only if key already exists and holds a list.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L584","def":{"name":"lpushx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LPUSHX\", key.to_s, value.to_s])"}},{"id":"lrange(key,from,to)-instance-method","html_id":"lrange(key,from,to)-instance-method","name":"lrange","doc":"Returns the specified elements of the list stored at key.\n\n**Return value**: Array(String), the list of elements in the specified range.\n\nExample:\n\n```\nredis.lrange(\"mylist\", 0, 2)\n```","summary":"

    Returns the specified elements of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"","external_name":"to","restriction":""}],"args_string":"(key, from, to)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L669","def":{"name":"lrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"LRANGE\", key.to_s, from.to_s, to.to_s])"}},{"id":"lrem(key,count,value)-instance-method","html_id":"lrem(key,count,value)-instance-method","name":"lrem","doc":"Removes the first count occurrences of elements equal to value from the list stored at key.\n\n**Return value**: Integer, the number of removed elements.\n\nExample:\n\n```\nredis.lrem(\"mylist\", 1, \"my\")\n```","summary":"

    Removes the first count occurrences of elements equal to value from the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"","external_name":"count","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, count, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L604","def":{"name":"lrem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"","external_name":"count","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LREM\", key.to_s, count.to_s, value.to_s])"}},{"id":"lset(key,index,value)-instance-method","html_id":"lset(key,index,value)-instance-method","name":"lset","doc":"Sets the list element at index to value.\n\n**Return value**: \"OK\"","summary":"

    Sets the list element at index to value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L625","def":{"name":"lset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"LSET\", key.to_s, index.to_s, value.to_s])"}},{"id":"ltrim(key,start,stop)-instance-method","html_id":"ltrim(key,start,stop)-instance-method","name":"ltrim","doc":"Trim an existing list so that it will contain only the specified range of elements specified.\n\n**Return value**: \"OK\"","summary":"

    Trim an existing list so that it will contain only the specified range of elements specified.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L676","def":{"name":"ltrim","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"LTRIM\", key.to_s, start.to_s, stop.to_s])"}},{"id":"mget(*keys)-instance-method","html_id":"mget(*keys)-instance-method","name":"mget","doc":"Returns the values of all specified keys.\n\n**Return value**: Array(String), the list of values at the specified keys.\nFor every key that does not hold a string value or does not exist, nil is returned.\n\nExample:\n\n```\nredis.set(\"foo1\", \"test1\")\nredis.set(\"foo2\", \"test2\")\nredis.mget(\"foo1\", \"foo2\") # => [\"test1\", \"test2\"]\n```","summary":"

    Returns the values of all specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L219","def":{"name":"mget","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"MGET\"], keys))"}},{"id":"mget(keys:Array)-instance-method","html_id":"mget(keys:Array)-instance-method","name":"mget","doc":null,"summary":null,"abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"args_string":"(keys : Array)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L223","def":{"name":"mget","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"MGET\"], keys))"}},{"id":"mset(hash:Hash)-instance-method","html_id":"mset(hash:Hash)-instance-method","name":"mset","doc":"Sets the given keys to their respective values as defined in the hash.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.mset({\"foo1\": \"bar1\", \"foo2\": \"bar2\"})\n```","summary":"

    Sets the given keys to their respective values as defined in the hash.

    ","abstract":false,"args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":"Hash"}],"args_string":"(hash : Hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L236","def":{"name":"mset","args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":"Hash"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"MSET\"] of RedisValue\nhash.each do |key, value|\n (q << key.to_s) << value.to_s\nend\nstring_command(q)\n"}},{"id":"msetnx(hash)-instance-method","html_id":"msetnx(hash)-instance-method","name":"msetnx","doc":"Sets the given keys to their respective values as defined in the hash.\nMSETNX will not perform any operation at all even if just a single key already exists.\n\n**Return value**: Integer, specifically:\n* 1 if the all the keys were set.\n* 0 if no key was set (at least one key already existed).\n\nExample:\n\n```\nredis.msetnx({\"key1\": \"hello\", \"key2\": \"there\"})\n```","summary":"

    Sets the given keys to their respective values as defined in the hash.

    ","abstract":false,"args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"args_string":"(hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L296","def":{"name":"msetnx","args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"MSETNX\"] of RedisValue\nhash.each do |key, value|\n (q << key.to_s) << value\nend\ninteger_command(q)\n"}},{"id":"object_encoding(key)-instance-method","html_id":"object_encoding(key)-instance-method","name":"object_encoding","doc":"Returns the kind of internal representation used in order to store\nthe value associated with a key.\n\n**Return value**: String: returns the kind of internal representation\nused in order to store the value associated with a key.","summary":"

    Returns the kind of internal representation used in order to store the value associated with a key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1701","def":{"name":"object_encoding","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"OBJECT\", \"ENCODING\", key.to_s])"}},{"id":"object_idletime(key)-instance-method","html_id":"object_idletime(key)-instance-method","name":"object_idletime","doc":"Returns the number of seconds since the object stored at the specified key\nis idle (not requested by read or write operations).\n\n**Return value**: Integer: returns the number of seconds\nsince the object stored at the specified key is idle\n(not requested by read or write operations).","summary":"

    Returns the number of seconds since the object stored at the specified key is idle (not requested by read or write operations).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1711","def":{"name":"object_idletime","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"OBJECT\", \"IDLETIME\", key.to_s])"}},{"id":"object_refcount(key)-instance-method","html_id":"object_refcount(key)-instance-method","name":"object_refcount","doc":"Returns the number of references of the value associated\nwith the specified key.\n\n**Return value**: Integer: returns the number of references\nof the value associated with the specified key.","summary":"

    Returns the number of references of the value associated with the specified key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1692","def":{"name":"object_refcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"OBJECT\", \"REFCOUNT\", key.to_s])"}},{"id":"persist(key)-instance-method","html_id":"persist(key)-instance-method","name":"persist","doc":"Remove the existing timeout on key, turning the key from volatile\n(a key with an expire set) to persistent (a key that will never expire\nas no timeout is associated).\n\n**Return value**: Integer, specifically:\n* 1 if the timeout was removed.\n* 0 if key does not exist or does not have an associated timeout.","summary":"

    Remove the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1517","def":{"name":"persist","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PERSIST\", key.to_s])"}},{"id":"pexpire(key,milis)-instance-method","html_id":"pexpire(key,milis)-instance-method","name":"pexpire","doc":"This command works exactly like EXPIRE but the time to live of the key is\nspecified in milliseconds instead of seconds.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"milis","doc":null,"default_value":"","external_name":"milis","restriction":""}],"args_string":"(key, milis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1485","def":{"name":"pexpire","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"milis","doc":null,"default_value":"","external_name":"milis","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PEXPIRE\", key.to_s, milis.to_s])"}},{"id":"pexpireat(key,unix_date_in_millis)-instance-method","html_id":"pexpireat(key,unix_date_in_millis)-instance-method","name":"pexpireat","doc":"PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time\nat which the key will expire is specified in milliseconds instead of seconds.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time at which the key will expire is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date_in_millis","doc":null,"default_value":"","external_name":"unix_date_in_millis","restriction":""}],"args_string":"(key, unix_date_in_millis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1506","def":{"name":"pexpireat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date_in_millis","doc":null,"default_value":"","external_name":"unix_date_in_millis","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PEXPIREAT\", key.to_s, unix_date_in_millis.to_s])"}},{"id":"pfadd(key,*values)-instance-method","html_id":"pfadd(key,*values)-instance-method","name":"pfadd","doc":"Adds all the element arguments to the HyperLogLog data structure stored at\nthe variable name specified as first argument.\n\n**Return value**: Integer: 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.\n\nExample:\n\n```\nredis.pfadd(\"hll\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\") # => 1\n```","summary":"

    Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1366","def":{"name":"pfadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"PFADD\", key.to_s], values))"}},{"id":"pfcount(*keys)-instance-method","html_id":"pfcount(*keys)-instance-method","name":"pfcount","doc":"When called with a single key, returns the approximated cardinality computed\nby the HyperLogLog data structure stored at the specified variable,\nwhich is 0 if the variable does not exist.\n\n**Return value**: Integer, the approximated number of unique elements\nobserved via PFADD.","summary":"

    When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1385","def":{"name":"pfcount","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"PFCOUNT\"], keys))"}},{"id":"pfmerge(*keys)-instance-method","html_id":"pfmerge(*keys)-instance-method","name":"pfmerge","doc":"Merge multiple HyperLogLog values into an unique value that will\napproximate the cardinality of the union of the observed Sets of the\nsource HyperLogLog structures.\n\n**Return value**: \"OK\".","summary":"

    Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1375","def":{"name":"pfmerge","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command(concat([\"PFMERGE\"], keys))"}},{"id":"ping-instance-method","html_id":"ping-instance-method","name":"ping","doc":"Returns PONG. This command is often used to test if a connection is still alive, or to measure latency.\n\nExample:\n\n```\nredis.ping # => \"PONG\"\n```","summary":"

    Returns PONG.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L23","def":{"name":"ping","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"PING\"])"}},{"id":"psetex(key,expire_in_milis,value)-instance-method","html_id":"psetex(key,expire_in_milis,value)-instance-method","name":"psetex","doc":"PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.\n\n**Return value**: \"OK\"","summary":"

    PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_milis","doc":null,"default_value":"","external_name":"expire_in_milis","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, expire_in_milis, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L271","def":{"name":"psetex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_milis","doc":null,"default_value":"","external_name":"expire_in_milis","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"PSETEX\", key.to_s, expire_in_milis.to_s, value.to_s])"}},{"id":"psubscribe(*channel_patterns)-instance-method","html_id":"psubscribe(*channel_patterns)-instance-method","name":"psubscribe","doc":"Subscribes to more channel patterns while already being in a subscription loop.","summary":"

    Subscribes to more channel patterns while already being in a subscription loop.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1621","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\nelse\n raise(Redis::Error.new(\"Must call psubscribe with a subscription block\"))\nend\nvoid_command(concat([\"PSUBSCRIBE\"], channel_patterns))\n"}},{"id":"psubscribe(*channel_patterns,&callback_setup_block:Subscription->)-instance-method","html_id":"psubscribe(*channel_patterns,&callback_setup_block:Subscription->)-instance-method","name":"psubscribe","doc":"Subscribes to channel patterns and enters a subscription loop, waiting for events.\n\nThe method yields to the given block and passes a Subscription object, on\nwhich you can set your callbacks for the event subscription.\n\nThe subscription loop will end once you unsubscribe.","summary":"

    Subscribes to channel patterns and enters a subscription loop, waiting for events.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns, &callback_setup_block : Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1605","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Subscription -> )"},"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\n raise(Redis::Error.new(\"Must call psubscribe without a subscription block when inside a subscription loop\"))\nend\nsubscription = Subscription.new\ncallback_setup_block.call(subscription)\n@strategy = Redis::Strategy::SubscriptionLoop.new(connection, subscription)\npsubscribe(*channel_patterns)\n"}},{"id":"pttl(key)-instance-method","html_id":"pttl(key)-instance-method","name":"pttl","doc":"Like TTL this command returns the remaining time to live of a key that has\nan expire set, with the sole difference that TTL returns the amount of\nremaining time in seconds while PTTL returns it in milliseconds.\n\n**Return value**: Integer, the TTL in milliseconds, or a negative value in order to signal an error.","summary":"

    Like TTL this command returns the remaining time to live of a key that has an expire set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1534","def":{"name":"pttl","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PTTL\", key.to_s])"}},{"id":"publish(channel,message)-instance-method","html_id":"publish(channel,message)-instance-method","name":"publish","doc":"Posts a message to the given channel.\n\n**Return value**: Integer, the number of clients that received the message.\n\nExample:\n\n```\nredis.publish(\"mychannel\", \"some message\")\n```","summary":"

    Posts a message to the given channel.

    ","abstract":false,"args":[{"name":"channel","doc":null,"default_value":"","external_name":"channel","restriction":""},{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"args_string":"(channel, message)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1653","def":{"name":"publish","args":[{"name":"channel","doc":null,"default_value":"","external_name":"channel","restriction":""},{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PUBLISH\", channel.to_s, message.to_s])"}},{"id":"punsubscribe(*channel_patterns)-instance-method","html_id":"punsubscribe(*channel_patterns)-instance-method","name":"punsubscribe","doc":"Unsubscribes the client from the given patterns, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given patterns, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1640","def":{"name":"punsubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"void_command(concat([\"PUNSUBSCRIBE\"], channel_patterns))"}},{"id":"quit-instance-method","html_id":"quit-instance-method","name":"quit","doc":"Ask the server to close the connection. The connection is closed as soon as all pending replies have been written to the client.\n\n**Return value**: \"OK\"","summary":"

    Ask the server to close the connection.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L73","def":{"name":"quit","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"QUIT\"])"}},{"id":"randomkey-instance-method","html_id":"randomkey-instance-method","name":"randomkey","doc":"Return a random key from the currently selected database.","summary":"

    Return a random key from the currently selected database.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L531","def":{"name":"randomkey","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"RANDOMKEY\"])"}},{"id":"rename(old_key,new_key)-instance-method","html_id":"rename(old_key,new_key)-instance-method","name":"rename","doc":"Renames old_key to newkey.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.rename(\"old_name\", \"new_name\")\n```","summary":"

    Renames old_key to newkey.

    ","abstract":false,"args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"args_string":"(old_key, new_key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L107","def":{"name":"rename","args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"RENAME\", old_key.to_s, new_key.to_s])"}},{"id":"renamenx(old_key,new_key)-instance-method","html_id":"renamenx(old_key,new_key)-instance-method","name":"renamenx","doc":"Renames old_key to newkey if newkey does not yet exist.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.renamenx(\"old_name\", \"new_name\")\n```","summary":"

    Renames old_key to newkey if newkey does not yet exist.

    ","abstract":false,"args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"args_string":"(old_key, new_key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L120","def":{"name":"renamenx","args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"RENAMENX\", old_key.to_s, new_key.to_s])"}},{"id":"restore(key,ttl_in_milis:Int,serialized_value:String,replace=false)-instance-method","html_id":"restore(key,ttl_in_milis:Int,serialized_value:String,replace=false)-instance-method","name":"restore","doc":"Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP).\n\n**Return value**: The command returns \"OK\" on success.","summary":"

    Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"ttl_in_milis","doc":null,"default_value":"","external_name":"ttl_in_milis","restriction":"Int"},{"name":"serialized_value","doc":null,"default_value":"","external_name":"serialized_value","restriction":"String"},{"name":"replace","doc":null,"default_value":"false","external_name":"replace","restriction":""}],"args_string":"(key, ttl_in_milis : Int, serialized_value : String, replace = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L499","def":{"name":"restore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"ttl_in_milis","doc":null,"default_value":"","external_name":"ttl_in_milis","restriction":"Int"},{"name":"serialized_value","doc":null,"default_value":"","external_name":"serialized_value","restriction":"String"},{"name":"replace","doc":null,"default_value":"false","external_name":"replace","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"RESTORE\", key.to_s, ttl_in_milis.to_s, serialized_value]\nif replace\n q << \"REPLACE\"\nend\nstring_command(q)\n"}},{"id":"rpop(key)-instance-method","html_id":"rpop(key)-instance-method","name":"rpop","doc":"Removes and returns the last element of the list stored at key.\n\n**Return value**: \"OK\"","summary":"

    Removes and returns the last element of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L645","def":{"name":"rpop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"RPOP\", key.to_s])"}},{"id":"rpoplpush(source,destination)-instance-method","html_id":"rpoplpush(source,destination)-instance-method","name":"rpoplpush","doc":"Atomically returns and removes the last element (tail) of the list stored at source,\nand pushes the element at the first element (head) of the list stored at destination.\n\n**Return value**: String, the element being popped and pushed.","summary":"

    Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""}],"args_string":"(source, destination)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L891","def":{"name":"rpoplpush","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"RPOPLPUSH\", source.to_s, destination.to_s])"}},{"id":"rpush(key,*values)-instance-method","html_id":"rpush(key,*values)-instance-method","name":"rpush","doc":"Insert all the specified values at the tail of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.\n\nExample:\n\n```\nredis.rpush(\"mylist\", \"1\", \"2\", \"3\")\n```","summary":"

    Insert all the specified values at the tail of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L566","def":{"name":"rpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"RPUSH\", key.to_s], values))"}},{"id":"rpushx(key,value)-instance-method","html_id":"rpushx(key,value)-instance-method","name":"rpushx","doc":"Inserts value at the tail of the list stored at key, only if key already exists and holds a list.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Inserts value at the tail of the list stored at key, only if key already exists and holds a list.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L591","def":{"name":"rpushx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"RPUSHX\", key.to_s, value.to_s])"}},{"id":"sadd(key,*values)-instance-method","html_id":"sadd(key,*values)-instance-method","name":"sadd","doc":"Add the specified members to the set stored at key.\n\n**Return value**: Integer, the number of elements that were added to the set, not including all the elements already present into the set.","summary":"

    Add the specified members to the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L683","def":{"name":"sadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SADD\", key.to_s], values))"}},{"id":"sadd(key,values:Array(RedisValue))-instance-method","html_id":"sadd(key,values:Array(RedisValue))-instance-method","name":"sadd","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L687","def":{"name":"sadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SADD\", key.to_s], values))"}},{"id":"scan(cursor,match=nil,count=nil)-instance-method","html_id":"scan(cursor,match=nil,count=nil)-instance-method","name":"scan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array of String, a list of keys.\n\nExample:\n\n```\nredis.scan(0)\nredis.scan(0, \"foo*\")\nredis.scan(0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L523","def":{"name":"scan","args":[{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SCAN\", cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"scard(key)-instance-method","html_id":"scard(key)-instance-method","name":"scard","doc":"Returns the set cardinality (number of elements) of the set stored at key.","summary":"

    Returns the set cardinality (number of elements) of the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L725","def":{"name":"scard","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SCARD\", key.to_s])"}},{"id":"script_exists(sha1_array:Array(Reference))-instance-method","html_id":"script_exists(sha1_array:Array(Reference))-instance-method","name":"script_exists","doc":"Returns information about the existence of the scripts in the script cache.\n\n**Return value**: The command returns an array of integers that correspond\nto the specified SHA1 digest arguments.\nFor every corresponding SHA1 digest of a script that actually exists\nin the script cache, an 1 is returned, otherwise 0 is returned.","summary":"

    Returns information about the existence of the scripts in the script cache.

    ","abstract":false,"args":[{"name":"sha1_array","doc":null,"default_value":"","external_name":"sha1_array","restriction":"Array(Reference)"}],"args_string":"(sha1_array : Array(Reference))","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1439","def":{"name":"script_exists","args":[{"name":"sha1_array","doc":null,"default_value":"","external_name":"sha1_array","restriction":"Array(Reference)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_array_command(concat([\"SCRIPT\", \"EXISTS\"], sha1_array))"}},{"id":"script_flush-instance-method","html_id":"script_flush-instance-method","name":"script_flush","doc":"Flush the Lua scripts cache.\n\n**Return value**: \"OK\"","summary":"

    Flush the Lua scripts cache.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1460","def":{"name":"script_flush","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"FLUSH\"])"}},{"id":"script_kill-instance-method","html_id":"script_kill-instance-method","name":"script_kill","doc":"Kills the currently executing Lua script, assuming no write operation was\nyet performed by the script.\n\n**Return value**: \"OK\"","summary":"

    Kills the currently executing Lua script, assuming no write operation was yet performed by the script.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1429","def":{"name":"script_kill","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"KILL\"])"}},{"id":"script_load(script:String)-instance-method","html_id":"script_load(script:String)-instance-method","name":"script_load","doc":"Load a script into the scripts cache, without executing it.\n\n**Return value**: String, the SHA1 digest of the script\nadded into the script cache.\n\nExample:\n\n```\nredis.script_load(\"return {KEYS[1],ARGV[1]}\") # => \"a191862bfe0bd3bec995befcd060582bf4bdbd77\"\n```","summary":"

    Load a script into the scripts cache, without executing it.

    ","abstract":false,"args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"}],"args_string":"(script : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1421","def":{"name":"script_load","args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"LOAD\", script])"}},{"id":"sdiff(*keys)-instance-method","html_id":"sdiff(*keys)-instance-method","name":"sdiff","doc":"Returns the members of the set resulting from the difference between the first set and all the successive sets.\n\n**Return value**: Array(String), a list with members of the resulting set.","summary":"

    Returns the members of the set resulting from the difference between the first set and all the successive sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L732","def":{"name":"sdiff","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"SDIFF\"], keys))"}},{"id":"sdiffstore(destination,*keys)-instance-method","html_id":"sdiffstore(destination,*keys)-instance-method","name":"sdiffstore","doc":"This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(destination, *keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L739","def":{"name":"sdiffstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SDIFFSTORE\", destination.to_s], keys))"}},{"id":"select(database_number)-instance-method","html_id":"select(database_number)-instance-method","name":"select","doc":"Select the DB with having the specified zero-based numeric index.\n\n**Return value**: \"OK\"","summary":"

    Select the DB with having the specified zero-based numeric index.

    ","abstract":false,"args":[{"name":"database_number","doc":null,"default_value":"","external_name":"database_number","restriction":""}],"args_string":"(database_number)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L94","def":{"name":"select","args":[{"name":"database_number","doc":null,"default_value":"","external_name":"database_number","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SELECT\", database_number.to_s])"}},{"id":"set(key,value,ex=nil,px=nil,nx=nil,xx=nil)-instance-method","html_id":"set(key,value,ex=nil,px=nil,nx=nil,xx=nil)-instance-method","name":"set","doc":"Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type. Any previous time to live associated with the key is discarded on successful SET operation.\n\n**Options**:\n\n* Starting with Redis 2.6.12 SET supports a set of options that modify its behavior:\n* ex -- Set the specified expire time, in seconds.\n* px -- Set the specified expire time, in milliseconds.\n* nx -- Only set the key if it does not already exist.\n* xx -- Only set the key if it already exist.\n\n**Return value**:\n* OK if SET was executed correctly.\n* Null reply: nil is returned if the SET operation was not performed because the user specified the NX or XX option but the condition was not met.\n\nExample:\n\n```\nredis.set(\"foo\", \"test\")\nredis.set(\"bar\", \"test\", ex: 7)\n```","summary":"

    Set key to hold the string value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""},{"name":"ex","doc":null,"default_value":"nil","external_name":"ex","restriction":""},{"name":"px","doc":null,"default_value":"nil","external_name":"px","restriction":""},{"name":"nx","doc":null,"default_value":"nil","external_name":"nx","restriction":""},{"name":"xx","doc":null,"default_value":"nil","external_name":"xx","restriction":""}],"args_string":"(key, value, ex = nil, px = nil, nx = nil, xx = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L47","def":{"name":"set","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""},{"name":"ex","doc":null,"default_value":"nil","external_name":"ex","restriction":""},{"name":"px","doc":null,"default_value":"nil","external_name":"px","restriction":""},{"name":"nx","doc":null,"default_value":"nil","external_name":"nx","restriction":""},{"name":"xx","doc":null,"default_value":"nil","external_name":"xx","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SET\", key.to_s, value.to_s]\nif ex\n (q << \"EX\") << ex.to_s\nend\nif px\n (q << \"PX\") << px.to_s\nend\nif nx\n (q << \"NX\") << nx.to_s\nend\nif xx\n (q << \"XX\") << xx.to_s\nend\nstring_or_nil_command(q)\n"}},{"id":"setbit(key,index,value)-instance-method","html_id":"setbit(key,index,value)-instance-method","name":"setbit","doc":"Sets or clears the bit at offset in the string value stored at key.\n\n**Return value**: Integer: the original bit value stored at offset.\n\nExample:\n\n```\nredis.setbit(\"mykey\", 7, 1)\n```","summary":"

    Sets or clears the bit at offset in the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L460","def":{"name":"setbit","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETBIT\", key.to_s, index.to_s, value.to_s])"}},{"id":"setex(key,expire_in_seconds,value)-instance-method","html_id":"setex(key,expire_in_seconds,value)-instance-method","name":"setex","doc":"Set key to hold the string value and set key to timeout after a given number of seconds.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.setex(\"foo\", 3, \"bar\")\n```","summary":"

    Set key to hold the string value and set key to timeout after a given number of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_seconds","doc":null,"default_value":"","external_name":"expire_in_seconds","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, expire_in_seconds, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L264","def":{"name":"setex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_seconds","doc":null,"default_value":"","external_name":"expire_in_seconds","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SETEX\", key.to_s, expire_in_seconds.to_s, value.to_s])"}},{"id":"setnx(key,value)-instance-method","html_id":"setnx(key,value)-instance-method","name":"setnx","doc":"Set key to hold string value if key does not exist.\n\n**Return value**: Integer, specifically:\n* 1 if the key was set\n* 0 if the key was not set","summary":"

    Set key to hold string value if key does not exist.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L280","def":{"name":"setnx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETNX\", key.to_s, value.to_s])"}},{"id":"setrange(key,start_index,value)-instance-method","html_id":"setrange(key,start_index,value)-instance-method","name":"setrange","doc":"Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.\n\n**Return value**: Integer, the length of the string after it was modified by the command.\n\nExample:\n\n```\nredis.setrange(\"foo\", 6, \"Redis\")\n```","summary":"

    Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, start_index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L400","def":{"name":"setrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETRANGE\", key.to_s, start_index.to_s, value.to_s])"}},{"id":"sinter(*keys)-instance-method","html_id":"sinter(*keys)-instance-method","name":"sinter","doc":"Returns the members of the set resulting from the intersection of all the given sets.\n\n**Return value**: Array(String), an array with members of the resulting set.","summary":"

    Returns the members of the set resulting from the intersection of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L746","def":{"name":"sinter","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"SINTER\"], keys))"}},{"id":"sinterstore(destination_key,*keys)-instance-method","html_id":"sinterstore(destination_key,*keys)-instance-method","name":"sinterstore","doc":"This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.\n\nExample:\n\n```\nredis.sinterstore(\"destination\", \"key1\", \"key2\")\n```","summary":"

    This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(destination_key, *keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L759","def":{"name":"sinterstore","args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SINTERSTORE\", destination_key.to_s], keys))"}},{"id":"sismember(key,value)-instance-method","html_id":"sismember(key,value)-instance-method","name":"sismember","doc":"Returns if member is a member of the set stored at key.\n\n**Return value**: Integer, specifically:\n* 1 if the element is a member of the set.\n* 0 if the element is not a member of the set, or if key does not exist.","summary":"

    Returns if member is a member of the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L703","def":{"name":"sismember","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SISMEMBER\", key.to_s, value.to_s])"}},{"id":"smembers(key)-instance-method","html_id":"smembers(key)-instance-method","name":"smembers","doc":"Returns all the members of the set value stored at key.\n\n**Return value**: Array(String), all elements of the set.","summary":"

    Returns all the members of the set value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L694","def":{"name":"smembers","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"SMEMBERS\", key.to_s])"}},{"id":"smove(source,destination,member)-instance-method","html_id":"smove(source,destination,member)-instance-method","name":"smove","doc":"Move member from the set at source to the set at destination.\n\n**Return value**: Integer, specifically:\n* 1 if the element is moved.\n* 0 if the element is not a member of source and no operation was performed.","summary":"

    Move member from the set at source to the set at destination.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(source, destination, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L768","def":{"name":"smove","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SMOVE\", source.to_s, destination.to_s, member.to_s])"}},{"id":"sort(key,by=nil,limit=nil,get:Array(RedisValue)?=nil,order="ASC",alpha=false,store=nil)-instance-method","html_id":"sort(key,by=nil,limit=nil,get:Array(RedisValue)?=nil,order=&quot;ASC&quot;,alpha=false,store=nil)-instance-method","name":"sort","doc":"Returns or stores the elements contained in the list, set or sorted set at key.\n\n**Options**:\n\n* by - pattern for sorting by external keys\n* limit - Array of 2 strings [offset, count]\n* get - pattern for retrieving external keys\n* order - either 'ASC' or 'DESC'\n* alpha - true to sort lexicographically\n* store - key of destination list to store the result in\n\n**Return value**: Array(String), the list of sorted elements.\n\nExample:\n\n```\nredis.sort(\"mylist\") # => [...]\nredis.sort(\"mylist\", order: \"DESC\") # => [...]\n```","summary":"

    Returns or stores the elements contained in the list, set or sorted set at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"by","doc":null,"default_value":"nil","external_name":"by","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"get","doc":null,"default_value":"nil","external_name":"get","restriction":"Array(RedisValue) | ::Nil"},{"name":"order","doc":null,"default_value":"\"ASC\"","external_name":"order","restriction":""},{"name":"alpha","doc":null,"default_value":"false","external_name":"alpha","restriction":""},{"name":"store","doc":null,"default_value":"nil","external_name":"store","restriction":""}],"args_string":"(key, by = nil, limit = nil, get : Array(RedisValue)? = nil, order = "ASC", alpha = false, store = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L169","def":{"name":"sort","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"by","doc":null,"default_value":"nil","external_name":"by","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"get","doc":null,"default_value":"nil","external_name":"get","restriction":"Array(RedisValue) | ::Nil"},{"name":"order","doc":null,"default_value":"\"ASC\"","external_name":"order","restriction":""},{"name":"alpha","doc":null,"default_value":"false","external_name":"alpha","restriction":""},{"name":"store","doc":null,"default_value":"nil","external_name":"store","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SORT\", key.to_s]\nif by\n (q << \"BY\") << by.to_s\nend\nif limit\n if limit.size != 2\n raise(Error.new(\"limit must be an array of 2 elements (offset, count)\"))\n end\n offset, count = limit\n ((q << \"LIMIT\") << offset.to_s) << count.to_s\nend\nif get\n get.each do |pattern|\n (q << \"GET\") << pattern\n end\nend\nif order\n _order = order.upcase\n if [\"ASC\", \"DESC\"].includes?(_order)\n else\n raise(Error.new(\"Bad order #{order}\"))\n end\n q << _order\nend\nif alpha\n q << \"ALPHA\"\nend\nif store\n (q << \"STORE\") << store.to_s\nend\nstring_array_or_integer_command(q)\n"}},{"id":"spop(key,count=nil)-instance-method","html_id":"spop(key,count=nil)-instance-method","name":"spop","doc":"Removes and returns one or more random elements from the set value store at key.\n\nThe count argument will be available in a later Redis version and is not available in 2.6, 2.8, 3.0\n\n**Return value**: The removed element, or nil when key does not exist.","summary":"

    Removes and returns one or more random elements from the set value store at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L777","def":{"name":"spop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SPOP\", key.to_s]\nif count\n q << count.to_s\nend\nstring_array_or_string_or_nil_command(q)\n"}},{"id":"srandmember(key,count=nil)-instance-method","html_id":"srandmember(key,count=nil)-instance-method","name":"srandmember","doc":"When called with just the key argument, return a random element from the set value stored at key.\n\n**Options**:\n\n* count - Starting from Redis version 2.6, when called with the additional count argument, return an array of count distinct elements if count is positive. If called with a negative count the behavior changes and the command is allowed to return the same element multiple times.\n\n**Return value**:\n* String: without the additional count argument the command returns a Bulk Reply with the randomly selected element, or nil when key does not exist.\n* Array: when the additional count argument is passed the command returns an array of elements, or an empty array when key does not exist.","summary":"

    When called with just the key argument, return a random element from the set value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L795","def":{"name":"srandmember","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SRANDMEMBER\", key.to_s]\nif count\n q << count.to_s\nend\nstring_array_or_string_or_nil_command(q)\n"}},{"id":"srem(key,values:Array(RedisValue))-instance-method","html_id":"srem(key,values:Array(RedisValue))-instance-method","name":"srem","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L720","def":{"name":"srem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SREM\", key.to_s], values))"}},{"id":"srem(key,*values)-instance-method","html_id":"srem(key,*values)-instance-method","name":"srem","doc":"Remove the specified members from the set stored at key.\n\n**Return value**: Integer, The number of members that were removed from the set, not including non existing members.\n\nExample:\n\n```\nredis.srem(\"myset\", \"Hello\")\n```","summary":"

    Remove the specified members from the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L716","def":{"name":"srem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SREM\", key.to_s], values))"}},{"id":"sscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"sscan(key,cursor,match=nil,count=nil)-instance-method","name":"sscan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array(String), a list of Set members.\n\nExample:\n\n```\nredis.sscan(\"myset\", 0)\nredis.sscan(\"myset\", 0, \"foo*\")\nredis.sscan(\"myset\", 0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L819","def":{"name":"sscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"strlen(key)-instance-method","html_id":"strlen(key)-instance-method","name":"strlen","doc":"Returns the length of the string value stored at key.\n\n**Return value**: Integer, the length of the string at key, or 0 when key does not exist.","summary":"

    Returns the length of the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L373","def":{"name":"strlen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"STRLEN\", key.to_s])"}},{"id":"subscribe(*channels,&callback_setup_block:Subscription->)-instance-method","html_id":"subscribe(*channels,&callback_setup_block:Subscription->)-instance-method","name":"subscribe","doc":"Subscribes to channels and enters a subscription loop, waiting for events.\n\nThe method yields to the given block and passes a Subscription object, on\nwhich you can set your callbacks for the event subscription.\n\nThe subscription loop will end once you unsubscribe.\n\nSee also: `Subscription` class\nSee also: Example `subscribe.cr`\n\nExample:\n\n```\nredis.subscribe(\"mychannel\") do |on|\n on.message do |channel, message|\n puts \"Received message: #{message}\"\n if message == \"goodbye pal\"\n redis.unsubscribe\n end\n end\nend\n```","summary":"

    Subscribes to channels and enters a subscription loop, waiting for events.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels, &callback_setup_block : Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1574","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Subscription -> )"},"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\n raise(Redis::Error.new(\"Must call subscribe without a subscription block when already inside a subscription loop\"))\nend\nsubscription = Subscription.new\ncallback_setup_block.call(subscription)\n@strategy = Redis::Strategy::SubscriptionLoop.new(connection, subscription)\nsubscribe(*channels)\n"}},{"id":"subscribe(*channels)-instance-method","html_id":"subscribe(*channels)-instance-method","name":"subscribe","doc":"Subscribes to more channels while already being in a subscription loop.","summary":"

    Subscribes to more channels while already being in a subscription loop.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1590","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\nelse\n raise(Redis::Error.new(\"Must call subscribe with a subscription block\"))\nend\nvoid_command(concat([\"SUBSCRIBE\"], channels))\n"}},{"id":"sunion(*keys)-instance-method","html_id":"sunion(*keys)-instance-method","name":"sunion","doc":"Returns the members of the set resulting from the union of all the given sets.\n\n**Return value**: Array(String), with members of the resulting set.","summary":"

    Returns the members of the set resulting from the union of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L829","def":{"name":"sunion","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"SUNION\"], keys))"}},{"id":"sunionstore(destination,*keys)-instance-method","html_id":"sunionstore(destination,*keys)-instance-method","name":"sunionstore","doc":"This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(destination, *keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L836","def":{"name":"sunionstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SUNIONSTORE\", destination.to_s], keys))"}},{"id":"ttl(key)-instance-method","html_id":"ttl(key)-instance-method","name":"ttl","doc":"Returns the remaining time to live of a key that has a timeout.\n\n**Return value**: Integer: TTL in seconds, or a negative value in order to\nsignal an error (see the description above).","summary":"

    Returns the remaining time to live of a key that has a timeout.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1525","def":{"name":"ttl","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"TTL\", key.to_s])"}},{"id":"type(key)-instance-method","html_id":"type(key)-instance-method","name":"type","doc":"Returns the string representation of the type of the value stored at key.\n\n**Return value**: String, the type of key, or none when key does not exist.\n\nExample:\n\n```\nredis.set(\"foo\", 3)\nredis.type(\"foo\") # => \"string\"\n```","summary":"

    Returns the string representation of the type of the value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1548","def":{"name":"type","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"TYPE\", key.to_s])"}},{"id":"unsubscribe(*channels)-instance-method","html_id":"unsubscribe(*channels)-instance-method","name":"unsubscribe","doc":"Unsubscribes the client from the given channels, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given channels, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1635","def":{"name":"unsubscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"void_command(concat([\"UNSUBSCRIBE\"], channels))"}},{"id":"unwatch-instance-method","html_id":"unwatch-instance-method","name":"unwatch","doc":"Flushes all the previously watched keys for a transaction.\n\n**Return value**: \"OK\"","summary":"

    Flushes all the previously watched keys for a transaction.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1667","def":{"name":"unwatch","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"UNWATCH\"])"}},{"id":"watch(*keys)-instance-method","html_id":"watch(*keys)-instance-method","name":"watch","doc":"Marks the given keys to be watched for conditional execution of a transaction.\n\n**Return value**: \"OK\"","summary":"

    Marks the given keys to be watched for conditional execution of a transaction.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1660","def":{"name":"watch","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command(concat([\"WATCH\"], keys))"}},{"id":"zadd(key,scores_and_members:Array(RedisValue))-instance-method","html_id":"zadd(key,scores_and_members:Array(RedisValue))-instance-method","name":"zadd","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":"Array(RedisValue)"}],"args_string":"(key, scores_and_members : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1079","def":{"name":"zadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if (scores_and_members.size % 2) > 0\n raise(Error.new(\"zadd expects an array of scores mapped to members\"))\nend\ninteger_command(concat([\"ZADD\", key.to_s], scores_and_members))\n"}},{"id":"zadd(key,*scores_and_members)-instance-method","html_id":"zadd(key,*scores_and_members)-instance-method","name":"zadd","doc":"Adds all the specified members with the specified scores to the sorted set stored at key.\n\n**Return value**: Integer, the number of elements added to the sorted sets, not including elements already existing for which the score was updated.\n\nExample:\n\n```\nredis.zadd(\"myzset\", 1, \"one\")\nredis.zadd(\"myzset\", 2, \"two\", 3, \"three\")\n```","summary":"

    Adds all the specified members with the specified scores to the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":""}],"args_string":"(key, *scores_and_members)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1071","def":{"name":"zadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if (scores_and_members.size % 2) > 0\n raise(Error.new(\"zadd expects an array of scores mapped to members\"))\nend\ninteger_command(concat([\"ZADD\", key.to_s], scores_and_members))\n"}},{"id":"zcard(key)-instance-method","html_id":"zcard(key)-instance-method","name":"zcard","doc":"Returns the sorted set cardinality (number of elements) of the sorted set stored at key.\n\n**Return value**: Integer, the cardinality (number of elements) of the sorted set, or 0 if key does not exist.","summary":"

    Returns the sorted set cardinality (number of elements) of the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1111","def":{"name":"zcard","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZCARD\", key.to_s])"}},{"id":"zcount(key,min,max)-instance-method","html_id":"zcount(key,min,max)-instance-method","name":"zcount","doc":"Returns the number of elements in the sorted set at key with a score between min and max.\n\n**Return value**: Integer, the number of elements in the specified score range.","summary":"

    Returns the number of elements in the sorted set at key with a score between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1125","def":{"name":"zcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZCOUNT\", key.to_s, min.to_s, max.to_s])"}},{"id":"zincrby(key,increment,member)-instance-method","html_id":"zincrby(key,increment,member)-instance-method","name":"zincrby","doc":"Increments the score of member in the sorted set stored at key by increment.\n\n**Return value**: String, the new score of member (a double precision floating point number represented as String).","summary":"

    Increments the score of member in the sorted set stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, increment, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1139","def":{"name":"zincrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"ZINCRBY\", key.to_s, increment.to_s, member.to_s])"}},{"id":"zinterstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","html_id":"zinterstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","name":"zinterstore","doc":"Computes the intersection of numkeys sorted sets given by the specified keys,\nand stores the result in destination.\n\n**Options**:\n\n* weights - nil or Array(String): Using the WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set.\n* aggregate - With the AGGREGATE option, it is possible to specify how the results of the union are aggregated.\n\n**Return value**: Integer, the number of elements in the resulting sorted set at destination.\n\nExample:\n\n```\nredis.zinterstore(\"zset3\", [\"zset1\", \"zset2\"], weights: [2, 3])\n```","summary":"

    Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"args_string":"(destination, keys : Array, weights = nil, aggregate = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1184","def":{"name":"zinterstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"numkeys = keys.size\nq = concat([\"ZINTERSTORE\", destination.to_s, numkeys.to_s], keys)\nif weights\n q << \"WEIGHTS\"\n concat(q, weights)\nend\nif aggregate\n (q << \"AGGREGATE\") << aggregate.to_s\nend\ninteger_command(q)\n"}},{"id":"zlexcount(key,min,max)-instance-method","html_id":"zlexcount(key,min,max)-instance-method","name":"zlexcount","doc":"When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.\n\n**Return value**: Integer, the number of elements in the specified score range.","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1132","def":{"name":"zlexcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZLEXCOUNT\", key.to_s, min.to_s, max.to_s])"}},{"id":"zrange(key,start,stop,with_scores=false)-instance-method","html_id":"zrange(key,start,stop,with_scores=false)-instance-method","name":"zrange","doc":"Returns the specified range of elements in the sorted set stored at key.\n\n**Options**:\n\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), list of elements in the specified range (optionally with their scores, in case the with_scores option is true).\n\nExample:\n\n```\nredis.zrange(\"myzset\", 0, -1, with_scores: true) # => [\"one\", \"1\", \"uno\", \"1\", \"two\", \"2\", \"three\", \"3\"]\n```","summary":"

    Returns the specified range of elements in the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, start, stop, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1100","def":{"name":"zrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGE\", key.to_s, start.to_s, stop.to_s]\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrangebylex(key,min,max,limit=nil)-instance-method","html_id":"zrangebylex(key,min,max,limit=nil)-instance-method","name":"zrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command returns all the\nelements in the sorted set at key with a value between min and max.\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n\n**Return value**:","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"args_string":"(key, min, max, limit = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1227","def":{"name":"zrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGEBYLEX\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nstring_array_command(q)\n"}},{"id":"zrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","html_id":"zrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","name":"zrangebyscore","doc":"Returns all the elements in the sorted set at key with a score between\nmax and min (including elements with score equal to max or min).\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified score range (optionally with their scores).","summary":"

    Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, min, max, limit = nil, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1244","def":{"name":"zrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGEBYSCORE\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrank(key,member)-instance-method","html_id":"zrank(key,member)-instance-method","name":"zrank","doc":"Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.\n\n**Return value**:\n* If member exists in the sorted set, Integer: the rank of member.\n* If member does not exist in the sorted set or key does not exist: nil.","summary":"

    Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1155","def":{"name":"zrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"ZRANK\", key.to_s, member.to_s])"}},{"id":"zrem(key,member)-instance-method","html_id":"zrem(key,member)-instance-method","name":"zrem","doc":"Removes the specified members from the sorted set stored at key.\n\n**Return value**: Integer, the number of members removed from the sorted set, not including non existing members.","summary":"

    Removes the specified members from the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1146","def":{"name":"zrem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREM\", key.to_s, member.to_s])"}},{"id":"zremrangebylex(key,min,max)-instance-method","html_id":"zremrangebylex(key,min,max)-instance-method","name":"zremrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command removes all\nelements in the sorted set stored at key between the lexicographical range\nspecified by min and max.\n\n**Return value**: Integer, the number of elements removed.","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1314","def":{"name":"zremrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYLEX\", key.to_s, min.to_s, max.to_s])"}},{"id":"zremrangebyrank(key,start,stop)-instance-method","html_id":"zremrangebyrank(key,start,stop)-instance-method","name":"zremrangebyrank","doc":"Removes all elements in the sorted set stored at key with rank between start and stop.\n\n**Return value**: Integer, the number of elements removed.","summary":"

    Removes all elements in the sorted set stored at key with rank between start and stop.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1321","def":{"name":"zremrangebyrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYRANK\", key.to_s, start.to_s, stop.to_s])"}},{"id":"zremrangebyscore(key,start,stop)-instance-method","html_id":"zremrangebyscore(key,start,stop)-instance-method","name":"zremrangebyscore","doc":"Removes all elements in the sorted set stored at key with a score\nbetween min and max (inclusive).\n\n**Return value**: Integer, the number of elements removed.","summary":"

    Removes all elements in the sorted set stored at key with a score between min and max (inclusive).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1329","def":{"name":"zremrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYSCORE\", key.to_s, start.to_s, stop.to_s])"}},{"id":"zrevrange(key,start,stop,with_scores=false)-instance-method","html_id":"zrevrange(key,start,stop,with_scores=false)-instance-method","name":"zrevrange","doc":"Returns the specified range of elements in the sorted set stored at key.\n\n**Options**:\n\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified range (optionally with their scores, in case the with_scores option is true).","summary":"

    Returns the specified range of elements in the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, start, stop, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1262","def":{"name":"zrevrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGE\", key.to_s, start.to_s, stop.to_s]\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrevrangebylex(key,min,max,limit=nil)-instance-method","html_id":"zrevrangebylex(key,min,max,limit=nil)-instance-method","name":"zrevrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command returns all the\nelements in the sorted set at key with a value between min and max.\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n\n**Return value**:","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"args_string":"(key, min, max, limit = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1280","def":{"name":"zrevrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGEBYLEX\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nstring_array_command(q)\n"}},{"id":"zrevrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","html_id":"zrevrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","name":"zrevrangebyscore","doc":"Returns all the elements in the sorted set at key with a score between\nmax and min (including elements with score equal to max or min).\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified score range (optionally with their scores).","summary":"

    Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, min, max, limit = nil, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1297","def":{"name":"zrevrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGEBYSCORE\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrevrank(key,member)-instance-method","html_id":"zrevrank(key,member)-instance-method","name":"zrevrank","doc":"Returns the rank of member in the sorted set stored at key,\nwith the scores ordered from high to low.\n\n**Return value**:\n* If member exists in the sorted set, Integer: the rank of member.\n* If member does not exist in the sorted set or key does not exist: nil.","summary":"

    Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1165","def":{"name":"zrevrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"ZREVRANK\", key.to_s, member.to_s])"}},{"id":"zscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"zscan(key,cursor,match=nil,count=nil)-instance-method","name":"zscan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array(String), contains two elements, a member and its associated score, for every returned element of the sorted set.\n\nExample:\n\n```\nredis.zscan(\"myzset\", 0)\nredis.zscan(\"myzset\", 0, \"foo*\")\nredis.zscan(\"myzset\", 0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1349","def":{"name":"zscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"zscore(key,member)-instance-method","html_id":"zscore(key,member)-instance-method","name":"zscore","doc":"Returns the score of member in the sorted set at key.\n\n**Return value**: String, the score of member (a double precision floating point number).","summary":"

    Returns the score of member in the sorted set at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1118","def":{"name":"zscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"ZSCORE\", key.to_s, member.to_s])"}},{"id":"zunionstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","html_id":"zunionstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","name":"zunionstore","doc":"Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.\n\n**Options**:\n\n* weights - nil or Array(String): Using the WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set.\n* aggregate - With the AGGREGATE option, it is possible to specify how the results of the union are aggregated.\n\n**Return value**: Integer, the number of elements in the resulting sorted set at destination.","summary":"

    Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"args_string":"(destination, keys : Array, weights = nil, aggregate = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1205","def":{"name":"zunionstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"numkeys = keys.size\nq = concat([\"ZUNIONSTORE\", destination.to_s, numkeys.to_s], keys)\nif weights\n q << \"WEIGHTS\"\n concat(q, weights)\nend\nif aggregate\n (q << \"AGGREGATE\") << aggregate.to_s\nend\ninteger_command(q)\n"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandTimeoutError","path":"Redis/CommandTimeoutError.html","kind":"class","full_name":"Redis::CommandTimeoutError","name":"CommandTimeoutError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":18,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when the `command_timeout` option triggers - a command took too long because the Redis-server is blocked by another command or by a dump.","summary":"

    Raised when the command_timeout option triggers - a command took too long because the Redis-server is blocked by another command or by a dump.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","path":"Redis/ConnectionError.html","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":6,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CannotConnectError","kind":"class","full_name":"Redis::CannotConnectError","name":"CannotConnectError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionLostError","kind":"class","full_name":"Redis::ConnectionLostError","name":"ConnectionLostError"}],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"An error that makes the connection unusable.","summary":"

    An error that makes the connection unusable.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionLostError","path":"Redis/ConnectionLostError.html","kind":"class","full_name":"Redis::ConnectionLostError","name":"ConnectionLostError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":14,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when the connection to the Redis server is lost.","summary":"

    Raised when the connection to the Redis server is lost.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","path":"Redis/Error.html","kind":"class","full_name":"Redis::Error","name":"Error","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":2,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandTimeoutError","kind":"class","full_name":"Redis::CommandTimeoutError","name":"CommandTimeoutError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PoolTimeoutError","kind":"class","full_name":"Redis::PoolTimeoutError","name":"PoolTimeoutError"}],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Exception for errors raised by this shard.","summary":"

    Exception for errors raised by this shard.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Future","path":"Redis/Future.html","kind":"class","full_name":"Redis::Future","name":"Future","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/future.cr","line_number":6,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/future.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Futures are handles for values that will become available at a later point in time.\n\nThe API methods Redis#pipelined and Redis#multi make commands return futures instead of actual values.\n\nSee this [example](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/pipelining.cr).","summary":"

    Futures are handles for values that will become available at a later point in time.

    ","class_methods":[],"constructors":[{"id":"new-class-method","html_id":"new-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/future.cr#L9","def":{"name":"new","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"value-instance-method","html_id":"value-instance-method","name":"value","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/future.cr#L14","def":{"name":"value","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if @ready\n @value\nelse\n raise(Redis::Error.new(\"Future value not ready yet\"))\nend"}},{"id":"value=(new_value)-instance-method","html_id":"value=(new_value)-instance-method","name":"value=","doc":null,"summary":null,"abstract":false,"args":[{"name":"new_value","doc":null,"default_value":"","external_name":"new_value","restriction":""}],"args_string":"(new_value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/future.cr#L22","def":{"name":"value=","args":[{"name":"new_value","doc":null,"default_value":"","external_name":"new_value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@value = new_value\n@ready = true\n"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PipelineApi","path":"Redis/PipelineApi.html","kind":"class","full_name":"Redis::PipelineApi","name":"PipelineApi","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/pipeline_api.cr","line_number":18,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pipeline_api.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"API for sending commands in pipelined mode.\n\nUsed in Redis#pipelined.\n\nExample:\n\n```\nredis.pipelined do |pipeline|\n pipeline.set(\"foo1\", \"first\")\n pipeline.set(\"foo2\", \"second\")\nend\n```\n\nIn this example, the `pipeline` object passed to the block is a PipelineApi\nobject.","summary":"

    API for sending commands in pipelined mode.

    ","class_methods":[],"constructors":[{"id":"new(strategy)-class-method","html_id":"new(strategy)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"args_string":"(strategy)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pipeline_api.cr#L21","def":{"name":"new","args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(strategy)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PooledClient","path":"Redis/PooledClient.html","kind":"class","full_name":"Redis::PooledClient","name":"PooledClient","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/pooled_client.cr","line_number":20,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"A Redis client object that can be shared across multiple fibers.\nIt is backed by a connection pool of `Redis` instances and will automatically allocate and free these instances from/to the pool, per command.\n\nExample usage:\n\n```Crystal\nredis = Redis::PooledClient.new(host: ..., port: ..., ..., pool_size: 5)\n10.times do |i|\n spawn do\n redis.set(\"foo#{i}\", \"bar\")\n redis.get(\"foo#{i}\") # => \"bar\"\n end\nend\n```\n\nHere 10 fibers access the same `Redis::PooledClient` instance while automatically sharing 5 Redis connections.\n","summary":"

    A Redis client object that can be shared across multiple fibers.

    ","class_methods":[],"constructors":[{"id":"new(*args,pool_size=5,pool_timeout=5.0,**args2)-class-method","html_id":"new(*args,pool_size=5,pool_timeout=5.0,**args2)-class-method","name":"new","doc":"Accepts the same connection parameters like a `Redis` instance, plus the documented ones.\n\n* pool_size - the number of `Redis` to hold in the connection pool.\n* pool_timeout - the time to wait for a `Redis` instance to become available from the pool before dying with `Redis::PoolTimeoutError`.","summary":"

    Accepts the same connection parameters like a Redis instance, plus the documented ones.

    ","abstract":false,"args":[{"name":"args","doc":null,"default_value":"","external_name":"args","restriction":""},{"name":"pool_size","doc":null,"default_value":"5","external_name":"pool_size","restriction":""},{"name":"pool_timeout","doc":null,"default_value":"5.0","external_name":"pool_timeout","restriction":""}],"args_string":"(*args, pool_size = 5, pool_timeout = 5.0, **args2)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr#L29","def":{"name":"new","args":[{"name":"args","doc":null,"default_value":"","external_name":"args","restriction":""},{"name":"pool_size","doc":null,"default_value":"5","external_name":"pool_size","restriction":""},{"name":"pool_timeout","doc":null,"default_value":"5.0","external_name":"pool_timeout","restriction":""}],"double_splat":{"name":"args2","doc":null,"default_value":"","external_name":"args2","restriction":""},"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(*args, **args2, pool_size: pool_size, pool_timeout: pool_timeout)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"pool:ConnectionPool(Redis)-instance-method","html_id":"pool:ConnectionPool(Redis)-instance-method","name":"pool","doc":"The connection pool.\nSee [https://github.com/ysbaddaden/pool](https://github.com/ysbaddaden/pool)","summary":"

    The connection pool.

    ","abstract":false,"args":[],"args_string":" : ConnectionPool(Redis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr#L23","def":{"name":"pool","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@pool"}},{"id":"psubscribe(*channel_patterns,&callback_setup_block:Redis::Subscription->)-instance-method","html_id":"psubscribe(*channel_patterns,&callback_setup_block:Redis::Subscription->)-instance-method","name":"psubscribe","doc":null,"summary":null,"abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns, &callback_setup_block : Redis::Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr#L59","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Redis::Subscription -> )"},"return_type":"","visibility":"Public","body":"with_pool_connection(&.psubscribe(*channel_patterns) do |s|\n callback_setup_block.call(s)\nend)"}},{"id":"subscribe(*channels,&callback_setup_block:Redis::Subscription->)-instance-method","html_id":"subscribe(*channels,&callback_setup_block:Redis::Subscription->)-instance-method","name":"subscribe","doc":null,"summary":null,"abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels, &callback_setup_block : Redis::Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr#L55","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Redis::Subscription -> )"},"return_type":"","visibility":"Public","body":"with_pool_connection(&.subscribe(*channels) do |s|\n callback_setup_block.call(s)\nend)"}}],"macros":[{"id":"method_missing(call)-macro","html_id":"method_missing(call)-macro","name":"method_missing","doc":null,"summary":null,"abstract":false,"args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"args_string":"(call)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr#L35","def":{"name":"method_missing","args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"double_splat":null,"splat_index":null,"block_arg":null,"visibility":"Public","body":" \n# Delegates all Redis commands to a `Redis` instance from the connection pool.\n\n with_pool_connection \n{ |conn| conn.\n{{ call }}\n }\n \n"}}],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PoolTimeoutError","path":"Redis/PoolTimeoutError.html","kind":"class","full_name":"Redis::PoolTimeoutError","name":"PoolTimeoutError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":22,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when no free connection became available in the pool within a certain time.","summary":"

    Raised when no free connection became available in the pool within a certain time.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/SocketWrapper","path":"Redis/SocketWrapper.html","kind":"struct","full_name":"Redis::SocketWrapper","name":"SocketWrapper","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"github.com/stefanwille/crystal-redis/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/socket_wrapper.cr","line_number":4,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/socket_wrapper.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Wraps an open socket connection.\n\nThe purpose is to be able to convert all exceptions to Redis:Error's.","summary":"

    Wraps an open socket connection.

    ","class_methods":[],"constructors":[{"id":"new(socket:TCPSocket|UNIXSocket|OpenSSL::SSL::Socket::Client)-class-method","html_id":"new(socket:TCPSocket|UNIXSocket|OpenSSL::SSL::Socket::Client)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"socket","doc":null,"default_value":"","external_name":"socket","restriction":"TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client"}],"args_string":"(socket : TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/socket_wrapper.cr#L5","def":{"name":"new","args":[{"name":"socket","doc":null,"default_value":"","external_name":"socket","restriction":"TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(socket)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"id":"new(&block)-class-method","html_id":"new(&block)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/socket_wrapper.cr#L9","def":{"name":"new","args":[],"double_splat":null,"splat_index":null,"yields":0,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n self.new(yield)\nrescue ex : IO::Timeout | Errno | Socket::Error | OpenSSL::Error\n raise(Redis::CannotConnectError.new(\"#{ex.class}: #{ex.message}\"))\nend"}}],"instance_methods":[{"id":"close-instance-method","html_id":"close-instance-method","name":"close","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/socket_wrapper.cr#L27","def":{"name":"close","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n if @connected\n @connected = false\n @socket.close\n end\nrescue Errno\nend"}}],"macros":[{"id":"method_missing(call)-macro","html_id":"method_missing(call)-macro","name":"method_missing","doc":null,"summary":null,"abstract":false,"args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"args_string":"(call)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/socket_wrapper.cr#L15","def":{"name":"method_missing","args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"double_splat":null,"splat_index":null,"block_arg":null,"visibility":"Public","body":" catch_errors \n{ @socket.\n{{ call }}\n }\n \n"}}],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Subscription","path":"Redis/Subscription.html","kind":"class","full_name":"Redis::Subscription","name":"Subscription","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/subscription.cr","line_number":5,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Models a subscription to one or more publish/subscribe channels.\n\nThe caller sets callbacks on this object that the Redis client will\ntrigger for the matching events.","summary":"

    Models a subscription to one or more publish/subscribe channels.

    ","class_methods":[],"constructors":[],"instance_methods":[{"id":"message(&message_callback:String,String->)-instance-method","html_id":"message(&message_callback:String,String->)-instance-method","name":"message","doc":"Sets the 'message' callback.","summary":"

    Sets the 'message' callback.

    ","abstract":false,"args":[],"args_string":"(&message_callback : String, String -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L28","def":{"name":"message","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"message_callback","doc":null,"default_value":"","external_name":"message_callback","restriction":"(String, String -> )"},"return_type":"","visibility":"Public","body":"@message_callback = message_callback"}},{"id":"pmessage(&pmessage_callback:String,String,String->)-instance-method","html_id":"pmessage(&pmessage_callback:String,String,String->)-instance-method","name":"pmessage","doc":"Sets the 'pmessage' callback.","summary":"

    Sets the 'pmessage' callback.

    ","abstract":false,"args":[],"args_string":"(&pmessage_callback : String, String, String -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L32","def":{"name":"pmessage","args":[],"double_splat":null,"splat_index":null,"yields":3,"block_arg":{"name":"pmessage_callback","doc":null,"default_value":"","external_name":"pmessage_callback","restriction":"(String, String, String -> )"},"return_type":"","visibility":"Public","body":"@pmessage_callback = pmessage_callback"}},{"id":"psubscribe(&psubscribe_callback:String,Int64->)-instance-method","html_id":"psubscribe(&psubscribe_callback:String,Int64->)-instance-method","name":"psubscribe","doc":"Sets the 'psubscribe' callback.","summary":"

    Sets the 'psubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&psubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L24","def":{"name":"psubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"psubscribe_callback","doc":null,"default_value":"","external_name":"psubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@psubscribe_callback = psubscribe_callback"}},{"id":"punsubscribe(&punsubscribe_callback:String,Int64->)-instance-method","html_id":"punsubscribe(&punsubscribe_callback:String,Int64->)-instance-method","name":"punsubscribe","doc":"Sets the 'punsubscribe' callback.","summary":"

    Sets the 'punsubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&punsubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L40","def":{"name":"punsubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"punsubscribe_callback","doc":null,"default_value":"","external_name":"punsubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@punsubscribe_callback = punsubscribe_callback"}},{"id":"subscribe(&subscribe_callback:String,Int64->)-instance-method","html_id":"subscribe(&subscribe_callback:String,Int64->)-instance-method","name":"subscribe","doc":"Sets the 'subscribe' callback.","summary":"

    Sets the 'subscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&subscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L20","def":{"name":"subscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"subscribe_callback","doc":null,"default_value":"","external_name":"subscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@subscribe_callback = subscribe_callback"}},{"id":"unsubscribe(&unsubscribe_callback:String,Int64->)-instance-method","html_id":"unsubscribe(&unsubscribe_callback:String,Int64->)-instance-method","name":"unsubscribe","doc":"Sets the 'unsubscribe' callback.","summary":"

    Sets the 'unsubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&unsubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L36","def":{"name":"unsubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"unsubscribe_callback","doc":null,"default_value":"","external_name":"unsubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@unsubscribe_callback = unsubscribe_callback"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/TransactionApi","path":"Redis/TransactionApi.html","kind":"class","full_name":"Redis::TransactionApi","name":"TransactionApi","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/transaction_api.cr","line_number":19,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/transaction_api.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"API for sending commands in a transaction.\n\nUsed in Redis#multi.\n\n\nExample:\n\n```\nredis.multi do |multi|\n multi.set(\"foo1\", \"first\")\n multi.set(\"foo2\", \"second\")\nend\n```\n\nIn this example, the `multi` object passed to the block is a TransactionApi\nobject.","summary":"

    API for sending commands in a transaction.

    ","class_methods":[],"constructors":[{"id":"new(strategy)-class-method","html_id":"new(strategy)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"args_string":"(strategy)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/transaction_api.cr#L22","def":{"name":"new","args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(strategy)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"discard-instance-method","html_id":"discard-instance-method","name":"discard","doc":"Aborts the current transaction.\n\n**Example**:\n\n```\nredis.multi do |multi|\n multi.set(\"foo\", \"the new value\")\n multi.discard\nend\n```","summary":"

    Aborts the current transaction.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/transaction_api.cr#L39","def":{"name":"discard","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@strategy.discard"}}],"macros":[],"types":[]}]}]}} \ No newline at end of file +{"repository_name":"github.com/stefanwille/crystal-redis","body":"# Redis Client for Crystal\n\n[![Build Status](https://img.shields.io/travis/stefanwille/crystal-redis/master.svg?style=flat)](https://travis-ci.org/stefanwille/crystal-redis) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests)\n\nA Redis client for the Crystal programming language.\n\n## Features\n\n- Performance (> 680,000 commands per second using pipeline on a MacBook Air with a single client thread)\n- Pipelining\n- Transactions\n- LUA Scripting\n- All string commands\n- All hash commands\n- All list commands\n- All set commands\n- All hyperloglog commands\n- All commands for bit operations\n- All sorted set commands\n- Publish/subscribe\n\n## Installation\n\nAdd it to your `shard.yml`:\n\n```crystal\ndependencies:\n redis:\n github: stefanwille/crystal-redis\n version: ~> 2.3.0\n```\n\nand then install the library into your project:\n\n```bash\n$ shards install\n```\n\n### Installation on MacOS X\n\nOn MacOS X you may get this error:\n\n```\nld: library not found for -lssl (this usually means you need to install the development package for libssl)\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\n...\n```\n\nOr this warning:\n\n```\nPackage libssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libssl.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'libssl' found\nPackage libcrypto was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libcrypto.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'libcrypto' found\n```\n\nThe problem is that Crystal can't find openssl, because it is not installed by default on MacOS X.\n\nThe fix:\n\n1. Install openssl via [Homebrew](https://brew.sh/):\n\n```bash\n$ brew install openssl\n```\n\n2. Set the environment variable `PKG_CONFIG_PATH`:\n\n```bash\n$ export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig\n```\n\nNote: Please write me if you know a better way!\n\n## Required Crystal Version\n\nThis library needs Crystal version >= 0.25.0\n\nI haven't tested older Crystal versions.\n\n## Usage\n\nRequire the package:\n\n```crystal\n require \"redis\"\n```\n\nthen\n\n```crystal\n redis = Redis.new\n```\n\nThen you can call Redis commands on the `redis` object:\n\n```crystal\n redis.set(\"foo\", \"bar\")\n redis.get(\"foo\")\n```\n\n#### Connection Pooling\n\nSince version 2.0.0, a connection pool is built in. It is used implicitly through `Redis::PooledClient`:\n\n```Crystal\nredis = Redis::PooledClient.new\n10.times do |i|\n spawn do\n redis.set(\"foo#{i}\", \"bar\")\n redis.get(\"foo#{i}\") # => \"bar\"\n end\nend\n```\n\nThis `redis` instance can be shared across fibers, and accepts the same Redis commands as the `Redis` class.\nIt automatically allocates and frees connections from/to the pool, per command.\n\n## Examples\n\nTo get started, see the examples:\n\n- There is a separate git repository [crystal-redis-examples](https://github.com/stefanwille/crystal-redis-examples) with examples.\n- start with this [basic example](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/basic.cr)\n- look at [the other examples](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/)\n- the [spec](https://github.com/stefanwille/crystal-redis/blob/master/spec/redis_spec.cr) contains even more usage examples\n\n## Documentation\n\n- [API documentation](http://stefanwille.github.io/crystal-redis) -\n start reading it at the class `Redis`.\n- [Redis commands documentation](http://redis.io/commands) - the original Redis documentation is necessary, as the API documentation above is just a quick reference\n- [Redis documentation page](http://redis.io/documentation) - general information about Redis and its concepts\n\n## Performance\n\nI have benchmarked Crystal-Redis against several other client libraries in various programming languages in this [blog article](http://www.stefanwille.com/2015/05/redis-clients-crystal-vs-ruby-vs-c-vs-go/).\n\nHere are some results:\n\n- Crystal: With this library I get > 680,000 commands per second using pipeline on a MacBook Air with a single client thread.\n\n- C: The equivalent program written in C with Hiredis gets me 340,000 commands per second.\n\n- Ruby: Ruby 2.2.1 with the [redis-rb](https://github.com/redis/redis-rb) and Hiredis driver handles 150,000 commands per second.\n\n[Read more results](http://www.stefanwille.com/2015/05/redis-clients-crystal-vs-ruby-vs-c-vs-go/) for Go, Java, Node.js.\n\n## Status\n\nI have exercised every API method in the spec and built some example programs. Some people report production usage.\n\nI took great care to make this library very usable with respect to API, reliability and documentation.\n\n## Development\n\nThis project requires a locally running redis server running on port 6379 and with a Unix socket located at /tmp/redis.sock. In Homebrew's default redis.config the Unix domain socket option is disabled. To enable, edit `/usr/local/etc/redis.conf` or whatever your `redis.conf` is and uncomment this line:\n\n```\n# unixsocket /tmp/redis.sock\n```\n\nso that it reads\n\n```\nunixsocket /tmp/redis.sock\n```\n\nThen you can run the specs via\n\n`$ crystal spec`\n\n[See more information](https://github.com/stefanwille/crystal-redis/blob/master/CONTRIBUTING.md).\n\n### WARNING\n\nRunning the spec will delete database number 0!\n\n## Questions, Bugs & Support\n\nIf you have questions or need help, please open a ticket in the [GitHub issue tracker](https://github.com/stefanwille/crystal-redis/issues). This way others can benefit from the discussion.\n","program":{"html_id":"github.com/stefanwille/crystal-redis/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"superclass":null,"ancestors":[],"locations":[],"repository_name":"github.com/stefanwille/crystal-redis","program":true,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":null,"doc":null,"summary":null,"class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis","path":"Redis.html","kind":"class","full_name":"Redis","name":"Redis","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/ValueOriented","kind":"module","full_name":"Redis::CommandExecution::ValueOriented","name":"ValueOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/commands.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr"},{"filename":"redis/command_execution/value_oriented.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/command_execution/value_oriented.cr"},{"filename":"redis.cr","line_number":37,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr"},{"filename":"redis/command_execution/future_oriented.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/command_execution/future_oriented.cr"},{"filename":"redis/strategy/base.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/strategy/base.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/ValueOriented","kind":"module","full_name":"Redis::CommandExecution::ValueOriented","name":"ValueOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":null,"doc":"The class is the main entry point for the Redis client.\n\n**How to use**:\n\nRequire the package:\n\n```crystal\nrequire \"redis\"\n```\n\nThen instantiate this client class:\n\n```crystal\nredis = Redis.new\n```\n\nThen you can call Redis commands on the `redis` object:\n\n```crystal\nredis.set(\"foo\", \"bar\")\nredis.get(\"foo\")\nredis.incr(\"visitors\")\n```\n\nSee the mixin module [Commands](Redis/Commands.html) for most\nof the available Redis commands such as #incr, #rename, and so on.\n\n**Multithreading / Coroutines**\n\nPlease mind that a Redis object can't be shared across multiple threads/coroutines!\nEach thread/coroutine that wants to talk to Redis needs its own Redis object instance.","summary":"

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

    ","class_methods":[{"id":"open(host="localhost",port=6379,unixsocket=nil,password=nil,database=nil,url=nil,ssl=false,ssl_context=nil,dns_timeout=nil,connect_timeout=nil,reconnect=true,command_timeout=nil,&block)-class-method","html_id":"open(host=&quot;localhost&quot;,port=6379,unixsocket=nil,password=nil,database=nil,url=nil,ssl=false,ssl_context=nil,dns_timeout=nil,connect_timeout=nil,reconnect=true,command_timeout=nil,&block)-class-method","name":"open","doc":"Opens a Redis connection, yields the given block with a Redis object and closes the connection.\n\n**Options**:\n* host - the host to connect to\n* port - the port to connect to\n* unixsocket - instead of using TCP, you can connect to Redis via a Unix domain socket by passing its path here (e.g. \"/tmp/redis.sock\")\n* password - the password for authentication against the server. This is a convenience which saves you the extra call to the Redis `auth` command.\n* database - the number of the database to select. This a convenience which saves you a call a call to `#select`.\n* ssl - whether SSL should be enabled.\n* ssl_context - a OpenSSL::SSL::Context::Client.\n* dns_timeout - the dns timeout.\n* connect_timeout - the connect timeout.\n* command_timeout - the command timeout - applies when a command takes too long because the Redis-server is blocked by another command or by a dump.\n* reconnect - whether we should reconnect when we encounter a disconnected Redis connection.\n* url - Redis url. If this is given, it overrides all others.\n\nExample:\n\n```\nRedis.open do |redis|\n redis.incr(\"counter\")\nend\n```","summary":"

    Opens a Redis connection, yields the given block with a Redis object and closes the connection.

    ","abstract":false,"args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":""},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":""},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":""},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":""},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":""},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":""},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":""}],"args_string":"(host = "localhost", port = 6379, unixsocket = nil, password = nil, database = nil, url = nil, ssl = false, ssl_context = nil, dns_timeout = nil, connect_timeout = nil, reconnect = true, command_timeout = nil, &block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L193","def":{"name":"open","args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":""},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":""},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":""},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":""},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":""},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":""},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":""}],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"redis = Redis.new(host, port, unixsocket, password, database, url, ssl, ssl_context, dns_timeout, connect_timeout, reconnect, command_timeout)\nbegin\n yield redis\nensure\n redis.close\nend\n"}}],"constructors":[{"id":"new(host="localhost",port=6379,unixsocket:String?=nil,password:String?=nil,database:Int32?=nil,url=nil,ssl=false,ssl_context:OpenSSL::SSL::Context::Client?=nil,dns_timeout:Time::Span?=nil,connect_timeout:Time::Span?=nil,reconnect=true,command_timeout:Time::Span?=nil)-class-method","html_id":"new(host=&quot;localhost&quot;,port=6379,unixsocket:String?=nil,password:String?=nil,database:Int32?=nil,url=nil,ssl=false,ssl_context:OpenSSL::SSL::Context::Client?=nil,dns_timeout:Time::Span?=nil,connect_timeout:Time::Span?=nil,reconnect=true,command_timeout:Time::Span?=nil)-class-method","name":"new","doc":"Opens a Redis connection\n\n**Options**:\n* host - the host to connect to\n* port - the port to connect to\n* unixsocket - instead of using TCP, you can connect to Redis via a Unix domain socket by passing its path here (e.g. \"/tmp/redis.sock\")\n* password - the password for authentication against the server. This is a convenience which saves you the extra call to the Redis `auth` command.\n* database - the number of the database to select. This a convenience which saves you a call a call to `#select`.\n* ssl - whether SSL should be enabled.\n* ssl_context - a OpenSSL::SSL::Context::Client.\n* dns_timeout - the dns timeout.\n* connect_timeout - the connect timeout.\n* command_timeout - the command timeout - applies when a command takes too long because the Redis-server is blocked by another command or by a dump.\n* reconnect - whether we should reconnect when we encounter a disconnected Redis connection.\n* url - Redis url. If this is given, it overrides all others.\n\nExample:\n\n```\nredis = Redis.new\nredis.incr(\"counter\")\nredis.close\n```\n\nExample:\n\n```\nredis = Redis.new(host: \"localhost\", port: 6379)\n...\n```\n\nExample:\n\n```\nredis = Redis.new(unixsocket: \"/tmp/redis.sock\")\n...\n```\n\nExample:\n\n```\nredis = Redis.new(url: \"redis://:my-secret-pw@my.redis.com:6380/my-database\")\n...\n```","summary":"

    Opens a Redis connection

    ","abstract":false,"args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":"String | ::Nil"},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":"Int32 | ::Nil"},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":"OpenSSL::SSL::Context::Client | ::Nil"},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":"Time::Span | ::Nil"},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":"Time::Span | ::Nil"},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":"Time::Span | ::Nil"}],"args_string":"(host = "localhost", port = 6379, unixsocket : String? = nil, password : String? = nil, database : Int32? = nil, url = nil, ssl = false, ssl_context : OpenSSL::SSL::Context::Client? = nil, dns_timeout : Time::Span? = nil, connect_timeout : Time::Span? = nil, reconnect = true, command_timeout : Time::Span? = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L95","def":{"name":"new","args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":"String | ::Nil"},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":"Int32 | ::Nil"},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":"OpenSSL::SSL::Context::Client | ::Nil"},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":"Time::Span | ::Nil"},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":"Time::Span | ::Nil"},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":"Time::Span | ::Nil"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(host, port, unixsocket, password, database, url, ssl, ssl_context, dns_timeout, connect_timeout, reconnect, command_timeout)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"close-instance-method","html_id":"close-instance-method","name":"close","doc":"Closes the Redis connection.","summary":"

    Closes the Redis connection.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L205","def":{"name":"close","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@connection.try(&.close)\n@connection = nil\n@strategy = nil\n"}},{"id":"multi(&block)-instance-method","html_id":"multi(&block)-instance-method","name":"multi","doc":"Sends Redis commands in transaction mode.\n\nYields its block. The block receives as argument\nan object that has the same API as this class, except:\n * it participates in the transaction\n * all the Redis commands return Futures\n * there is an additional method #discard that will abort the transaction.\n\n**Return value**: an array with all the responses\n- one element for each executed command.\n\nExample:\n\n```\nredis.multi do |multi|\n multi.set(\"foo1\", \"first\")\n multi.set(\"foo2\", \"second\")\nend\n```\n\nSee the [examples repository](https://github.com/stefanwille/crystal-redis-examples) for more examples.","summary":"

    Sends Redis commands in transaction mode.

    ","abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L284","def":{"name":"multi","args":[],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n @strategy = Redis::Strategy::PauseDuringTransaction.new\n transaction_strategy = Redis::Strategy::Transaction.new(connection)\n transaction_strategy.begin\n transaction_api = Redis::TransactionApi.new(transaction_strategy)\n yield transaction_api\n transaction_strategy.commit.as(Array(RedisValue))\nrescue ex : Redis::ConnectionError | Redis::CommandTimeoutError\n close\n raise(ex)\nensure\n if @connection\n @strategy = Redis::Strategy::SingleStatement.new(@connection.not_nil!)\n end\nend"}},{"id":"pipelined(&block)-instance-method","html_id":"pipelined(&block)-instance-method","name":"pipelined","doc":"Sends Redis commands in pipeline mode.\n\nYields its block. The block receives as argument\nan object that has the same API as this class, except\nit participates in pipelining and all Redis commands return Futures.\n\n**Return value**: an array with all the responses\n- one element for each executed command.\n\nExample:\n\n```\nredis.pipelined do |pipeline|\n pipeline.set(\"foo1\", \"first\")\n pipeline.set(\"foo2\", \"second\")\nend\n```\n\nSee the [examples repository](https://github.com/stefanwille/crystal-redis-examples) for more examples.","summary":"

    Sends Redis commands in pipeline mode.

    ","abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L248","def":{"name":"pipelined","args":[],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n @strategy = Redis::Strategy::PauseDuringPipeline.new\n pipeline_strategy = Redis::Strategy::Pipeline.new(connection)\n pipeline_api = Redis::PipelineApi.new(pipeline_strategy)\n yield pipeline_api\n pipeline_strategy.commit.as(Array(RedisValue))\nrescue ex : Redis::ConnectionError | Redis::CommandTimeoutError\n close\n raise(ex)\nensure\n if @connection\n @strategy = Redis::Strategy::SingleStatement.new(@connection.not_nil!)\n end\nend"}},{"id":"url-instance-method","html_id":"url-instance-method","name":"url","doc":"Returns the server URL for this client.","summary":"

    Returns the server URL for this client.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L212","def":{"name":"url","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"scheme = @ssl ? \"rediss\" : \"redis\"\nif @unixsocket\n \"#{scheme}://#{@unixsocket}/#{@database || 0}\"\nelse\n \"#{scheme}://#{@host}:#{@port}/#{@database || 0}\"\nend\n"}}],"macros":[],"types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CannotConnectError","path":"Redis/CannotConnectError.html","kind":"class","full_name":"Redis::CannotConnectError","name":"CannotConnectError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":10,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when connecting to the Redis server is not possible.","summary":"

    Raised when connecting to the Redis server is not possible.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","path":"Redis/Commands.html","kind":"module","full_name":"Redis::Commands","name":"Commands","abstract":false,"superclass":null,"ancestors":[],"locations":[{"filename":"redis/commands.cr","line_number":4,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PipelineApi","kind":"class","full_name":"Redis::PipelineApi","name":"PipelineApi"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/TransactionApi","kind":"class","full_name":"Redis::TransactionApi","name":"TransactionApi"}],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Definition of all Redis commands except pipelining and transactions.\n","summary":"

    Definition of all Redis commands except pipelining and transactions.

    ","class_methods":[],"constructors":[],"instance_methods":[{"id":"append(key,value)-instance-method","html_id":"append(key,value)-instance-method","name":"append","doc":"If key already exists and is a string, this command appends the value at the end of the string.\nIf key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.\n\n**Return value**: Integer, the length of the string after the append operation.\n\nExample:\n\n```\nredis.append(\"foo\", \" world\")\n```","summary":"

    If key already exists and is a string, this command appends the value at the end of the string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L366","def":{"name":"append","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"APPEND\", key.to_s, value.to_s])"}},{"id":"auth(password)-instance-method","html_id":"auth(password)-instance-method","name":"auth","doc":"Request for authentication in a password-protected Redis server.\n\n**Return value**: \"OK\"","summary":"

    Request for authentication in a password-protected Redis server.

    ","abstract":false,"args":[{"name":"password","doc":null,"default_value":"","external_name":"password","restriction":""}],"args_string":"(password)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L87","def":{"name":"auth","args":[{"name":"password","doc":null,"default_value":"","external_name":"password","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"AUTH\", password])"}},{"id":"bitcount(key,from=nil,to=nil)-instance-method","html_id":"bitcount(key,from=nil,to=nil)-instance-method","name":"bitcount","doc":"Count the number of set bits (population counting) in a string.\nBy default all the bytes contained in the string are examined.\n\n**Options**:\n\n* from / to - It is possible to specify the counting operation only in an interval passing the additional arguments from and to.\n\n**Return value** Integer, the number of bits set to 1.\n\nExample:\n\n```\nredis.bitcount(\"foo\", 0, 0)\n```","summary":"

    Count the number of set bits (population counting) in a string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"nil","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"args_string":"(key, from = nil, to = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L418","def":{"name":"bitcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"nil","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BITCOUNT\", key.to_s]\nif from\n if to\n q << from.to_s\n q << to.to_s\n else\n raise(Redis::Error.new(\"from specified, but not to\"))\n end\nend\ninteger_command(q)\n"}},{"id":"bitop(operation,key,*keys:String):Int64-instance-method","html_id":"bitop(operation,key,*keys:String):Int64-instance-method","name":"bitop","doc":"Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.\n\n**Return value**: Integer, the size of the string stored in the destination key, that is equal to the size of the longest input string.\n\nExample:\n\n```\nredis.bitop(\"and\", \"dest\", \"key1\", \"key2\")\n```","summary":"

    Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

    ","abstract":false,"args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(operation, key, *keys : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L445","def":{"name":"bitop","args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":2,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"bitop(operation, key, keys.to_a)"}},{"id":"bitop(operation,key,keys:Array(String)):Int64-instance-method","html_id":"bitop(operation,key,keys:Array(String)):Int64-instance-method","name":"bitop","doc":"Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.\n\n**Return value**: Integer, the size of the string stored in the destination key, that is equal to the size of the longest input string.\n\nExample:\n\n```\nredis.bitop(\"and\", \"dest\", \"key1\", \"key2\")\n```","summary":"

    Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

    ","abstract":false,"args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(operation, key, keys : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L440","def":{"name":"bitop","args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"BITOP\", operation.to_s, key.to_s], keys))"}},{"id":"bitpos(key,bit,start=nil,to=nil)-instance-method","html_id":"bitpos(key,bit,start=nil,to=nil)-instance-method","name":"bitpos","doc":"Return the position of the first bit set to 1 or 0 in a string.\n\n**Options**:\n\n* start / to - By default, all the bytes contained in the string are examined. It is possible to look for bits only in a specified interval passing the additional arguments start and to (it is possible to just pass start, the operation will assume that the to is the last byte of the string.\n\n**Return value**: Integer, the command returns the position of the first bit set to 1 or 0 according to the request.\n\nExample:\n\n```\nredis.set(\"mykey\", \"0\")\nredis.bitpos(\"mykey\", 1) # => 2\n```","summary":"

    Return the position of the first bit set to 1 or 0 in a string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"bit","doc":null,"default_value":"","external_name":"bit","restriction":""},{"name":"start","doc":null,"default_value":"nil","external_name":"start","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"args_string":"(key, bit, start = nil, to = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L483","def":{"name":"bitpos","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"bit","doc":null,"default_value":"","external_name":"bit","restriction":""},{"name":"start","doc":null,"default_value":"nil","external_name":"start","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BITPOS\", key.to_s, bit.to_s] of RedisValue\nif start\n q << start.to_s\n if to\n q << to\n end\nend\ninteger_command(q)\n"}},{"id":"blpop(keys,timeout_in_seconds)-instance-method","html_id":"blpop(keys,timeout_in_seconds)-instance-method","name":"blpop","doc":"BLPOP is a blocking list pop primitive.\nIt is the blocking version of LPOP because it blocks the connection when there\nare no elements to pop from any of the given lists.\nAn element is popped from the head of the first list that is non-empty,\nwith the given keys being checked in the order that they are given.\n\nThe timeout_in_seconds argument is interpreted as an integer value specifying the maximum number of seconds to block\n\n**Return value**: Array, specifically:\n* An array of nils when no element could be popped and the timeout expired.\n* An array of two-element arrays with the first element being the name of the key where an element was popped and the second element being the value of the popped element.\n\nExample:\n\n```\nredis.blpop([\"myotherlist\", \"mylist\"], 1) # => [\"mylist\", \"hello\"]\n```","summary":"

    BLPOP is a blocking list pop primitive.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(keys, timeout_in_seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L897","def":{"name":"blpop","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = concat([\"BLPOP\"], keys)\nq << timeout_in_seconds.to_s\narray_or_nil_command(q)\n"}},{"id":"brpop(keys,timeout_in_seconds)-instance-method","html_id":"brpop(keys,timeout_in_seconds)-instance-method","name":"brpop","doc":"BRPOP is a blocking list pop primitive.\nIt is the blocking version of RPOP because it blocks the connection when there\nare no elements to pop from any of the given lists.\nAn element is popped from the tail of the first list that is non-empty,\nwith the given keys being checked in the order that they are given.\n\nThe timeout_in_seconds argument is interpreted as an integer value specifying the maximum\nnumber of seconds to block.\n\n**Return value**: Array, specifically:\n* An array of nils when no element could be popped and the timeout expired.\n* An array of two-element arrays with the first element being the name of the key where an element was popped and the second element being the value of the popped element.\n\nExample:\n\n```\nredis.brpop([\"myotherlist\", \"mylist\"], 1) # => [\"mylist\", \"world\"]\n```","summary":"

    BRPOP is a blocking list pop primitive.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(keys, timeout_in_seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L921","def":{"name":"brpop","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = concat([\"BRPOP\"], keys)\nq << timeout_in_seconds.to_s\narray_or_nil_command(q)\n"}},{"id":"brpoplpush(source,destination,timeout_in_seconds=nil)-instance-method","html_id":"brpoplpush(source,destination,timeout_in_seconds=nil)-instance-method","name":"brpoplpush","doc":"BRPOPLPUSH is the blocking variant of RPOPLPUSH.\nWhen source contains elements, this command behaves exactly like RPOPLPUSH.\n\n**Options**:\n\n* timeout_in_seconds - interpreted as an integer value specifying the maximum number of seconds to block\n\nSee RPOPLPUSH for more information.\n\n**Return value**: String, the element being popped from source and pushed to destination.\nIf timeout is reached, nil is returned.\n\nExample:\n\n```\nredis.brpoplpush(\"source\", \"destination\", 0)\n```","summary":"

    BRPOPLPUSH is the blocking variant of RPOPLPUSH.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"nil","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(source, destination, timeout_in_seconds = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L952","def":{"name":"brpoplpush","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"nil","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BRPOPLPUSH\", source.to_s, destination.to_s]\nif timeout_in_seconds\n q << timeout_in_seconds.to_s\nend\nstring_or_nil_command(q)\n"}},{"id":"decr(key)-instance-method","html_id":"decr(key)-instance-method","name":"decr","doc":"Decrements the number stored at key by one.\n\n**Return value**: Integer, the value of key after the decrement","summary":"

    Decrements the number stored at key by one.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L319","def":{"name":"decr","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"DECR\", key.to_s])"}},{"id":"decrby(key,decrement)-instance-method","html_id":"decrby(key,decrement)-instance-method","name":"decrby","doc":"Decrements the number stored at key by decrement.\n\n**Return value**: Integer, the value of key after the decrement","summary":"

    Decrements the number stored at key by decrement.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"decrement","doc":null,"default_value":"","external_name":"decrement","restriction":""}],"args_string":"(key, decrement)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L352","def":{"name":"decrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"decrement","doc":null,"default_value":"","external_name":"decrement","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"DECRBY\", key.to_s, decrement.to_s])"}},{"id":"del(keys:Array)-instance-method","html_id":"del(keys:Array)-instance-method","name":"del","doc":"Removes the specified keys.\n\n**Return value**: Integer, the number of keys that were removed.\n\nExample:\n\n```\nredis.del([\"some\", \"keys\", \"to\", \"delete\"])\n```","summary":"

    Removes the specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"args_string":"(keys : Array)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L146","def":{"name":"del","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"DEL\"], keys))"}},{"id":"del(*keys)-instance-method","html_id":"del(*keys)-instance-method","name":"del","doc":"Removes the specified keys.\n\n**Return value**: Integer, the number of keys that were removed.\n\nExample:\n\n```\nredis.del(\"some\", \"keys\", \"to\", \"delete\")\n```","summary":"

    Removes the specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L133","def":{"name":"del","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"del(keys.to_a)"}},{"id":"dump(key)-instance-method","html_id":"dump(key)-instance-method","name":"dump","doc":"Serialize the value stored at key in a Redis-specific format and return it to the user.\n\n**Return value**: String, the serialized value.","summary":"

    Serialize the value stored at key in a Redis-specific format and return it to the user.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L497","def":{"name":"dump","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"DUMP\", key.to_s])"}},{"id":"echo(message)-instance-method","html_id":"echo(message)-instance-method","name":"echo","doc":"Returns the given message.\n\nExample:\n\n```\nredis.echo(\"Hello Redis\") # => \"Hello Redis\"\n```","summary":"

    Returns the given message.

    ","abstract":false,"args":[{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"args_string":"(message)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L12","def":{"name":"echo","args":[{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"ECHO\", message.to_s])"}},{"id":"eval(script:String,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","html_id":"eval(script:String,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","name":"eval","doc":"EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter\nbuilt into Redis starting from version 2.6.0.\n\n**Return value**: Array(String), depends on the executed script\n\nExample:\n\n```\nredis.eval(\"return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}\", [\"key1\", \"key2\"], [\"first art\", \"second arg\"])\n```","summary":"

    EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.

    ","abstract":false,"args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"args_string":"(script : String, keys = [] of RedisValue, args = [] of RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1457","def":{"name":"eval","args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"EVAL\", script, keys.size.to_s], keys, args))"}},{"id":"evalsha(sha1,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","html_id":"evalsha(sha1,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","name":"evalsha","doc":"EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter\nbuilt into Redis starting from version 2.6.0.\n\n**Return value**: Array(String), depends on the executed script","summary":"

    EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.

    ","abstract":false,"args":[{"name":"sha1","doc":null,"default_value":"","external_name":"sha1","restriction":""},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"args_string":"(sha1, keys = [] of RedisValue, args = [] of RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1465","def":{"name":"evalsha","args":[{"name":"sha1","doc":null,"default_value":"","external_name":"sha1","restriction":""},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"EVALSHA\", sha1.to_s, keys.size.to_s], keys, args))"}},{"id":"exists(key)-instance-method","html_id":"exists(key)-instance-method","name":"exists","doc":"Returns if key exists.\n\n**Return value**:\n* 1 if the key exists.\n* 0 if the key does not exist.","summary":"

    Returns if key exists.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L545","def":{"name":"exists","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXISTS\", key.to_s])"}},{"id":"expire(key,seconds)-instance-method","html_id":"expire(key,seconds)-instance-method","name":"expire","doc":"Set a timeout on key.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.\n\nExample:\n\n```\nredis.expire(\"temp\", 2)\n```","summary":"

    Set a timeout on key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"seconds","doc":null,"default_value":"","external_name":"seconds","restriction":""}],"args_string":"(key, seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1533","def":{"name":"expire","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"seconds","doc":null,"default_value":"","external_name":"seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXPIRE\", key.to_s, seconds.to_s])"}},{"id":"expireat(key,unix_date)-instance-method","html_id":"expireat(key,unix_date)-instance-method","name":"expireat","doc":"EXPIREAT has the same effect and semantic as EXPIRE, but instead of\nspecifying the number of seconds representing the TTL (time to live),\nit takes an absolute Unix timestamp (seconds since January 1, 1970).\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date","doc":null,"default_value":"","external_name":"unix_date","restriction":""}],"args_string":"(key, unix_date)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1554","def":{"name":"expireat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date","doc":null,"default_value":"","external_name":"unix_date","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXPIREAT\", key.to_s, unix_date.to_s])"}},{"id":"flushall-instance-method","html_id":"flushall-instance-method","name":"flushall","doc":"Flush all databases.\n\n**Return value**: \"OK\"","summary":"

    Flush all databases.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1511","def":{"name":"flushall","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"FLUSHALL\"])"}},{"id":"flushdb-instance-method","html_id":"flushdb-instance-method","name":"flushdb","doc":"Flush the current database.\n\n**Return value**: \"OK\"","summary":"

    Flush the current database.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1504","def":{"name":"flushdb","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"FLUSHDB\"])"}},{"id":"get(key)-instance-method","html_id":"get(key)-instance-method","name":"get","doc":"Get the value of key.\n\n**Return value**: a String or nil\n\nExample:\n\n```\nredis.set(\"foo\", \"test\")\nredis.get(\"foo\") # => \"test\"\n```","summary":"

    Get the value of key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L66","def":{"name":"get","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"GET\", key.to_s])"}},{"id":"getbit(key,index)-instance-method","html_id":"getbit(key,index)-instance-method","name":"getbit","doc":"Returns the bit value at offset in the string value stored at key.\n\n**Return value**: Integer, the bit value stored at offset.","summary":"

    Returns the bit value at offset in the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"args_string":"(key, index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L452","def":{"name":"getbit","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"GETBIT\", key.to_s, index.to_s])"}},{"id":"getrange(key,start_index,end_index)-instance-method","html_id":"getrange(key,start_index,end_index)-instance-method","name":"getrange","doc":"Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).\n\n\nExample:\n\n```\nredis.set(\"foo\", \"This is a string\")\nredis.getrange(\"foo\", 0, 3) # => \"This\"\nredis.getrange(\"foo\", -3, -1) # => \"ing\"\n```","summary":"

    Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"end_index","doc":null,"default_value":"","external_name":"end_index","restriction":""}],"args_string":"(key, start_index, end_index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L387","def":{"name":"getrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"end_index","doc":null,"default_value":"","external_name":"end_index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"GETRANGE\", key.to_s, start_index.to_s, end_index.to_s])"}},{"id":"getset(key,value)-instance-method","html_id":"getset(key,value)-instance-method","name":"getset","doc":"Atomically sets key to value and returns the old value stored at key.\n\n**Return value**: String, the old value stored at key, or nil when key did not exist.\n\nExample:\n\n```\nredis.getset(\"foo\", \"new\") # => (the old value)\n```","summary":"

    Atomically sets key to value and returns the old value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L251","def":{"name":"getset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"GETSET\", key.to_s, value])"}},{"id":"hdel(key,field)-instance-method","html_id":"hdel(key,field)-instance-method","name":"hdel","doc":"Removes the specified fields from the hash stored at key.\n\n**Return value**: Integer, the number of fields that were removed from the hash,\nnot including specified but non existing fields.","summary":"

    Removes the specified fields from the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1000","def":{"name":"hdel","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HDEL\", key.to_s, field.to_s])"}},{"id":"hexists(key,field)-instance-method","html_id":"hexists(key,field)-instance-method","name":"hexists","doc":"Returns if field is an existing field in the hash stored at key.\n\n**Return value**: Integer, specifically:\n* 1 if the hash contains field.\n* 0 if the hash does not contain field, or key does not exist.","summary":"

    Returns if field is an existing field in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1009","def":{"name":"hexists","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HEXISTS\", key.to_s, field.to_s])"}},{"id":"hget(key,field)-instance-method","html_id":"hget(key,field)-instance-method","name":"hget","doc":"Returns the value associated with field in the hash stored at key.\n\n**Return value**: String, the value associated with field, or nil\n\nExample:\n\n```\nredis.hget(\"myhash\", \"a\") # => \"434\"\n```","summary":"

    Returns the value associated with field in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L984","def":{"name":"hget","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"HGET\", key.to_s, field.to_s])"}},{"id":"hgetall(key)-instance-method","html_id":"hgetall(key)-instance-method","name":"hgetall","doc":"Returns all fields and values of the hash stored at key.\n\n**Return value**: Array(String) of fields and their values stored in the hash,\nor an empty array when key does not exist.","summary":"

    Returns all fields and values of the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L992","def":{"name":"hgetall","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HGETALL\", key.to_s])"}},{"id":"hincrby(key,field,increment)-instance-method","html_id":"hincrby(key,field,increment)-instance-method","name":"hincrby","doc":"Increments the number stored at field in the hash stored at key by increment.\n\n**Return value**: Integer, the value at field after the increment operation.\n\nExample:\n\n```\nredis.hincrby(\"myhash\", \"field1\", \"3\") # => 4\n```","summary":"

    Increments the number stored at field in the hash stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, field, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1022","def":{"name":"hincrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HINCRBY\", key.to_s, field.to_s, increment.to_s])"}},{"id":"hincrbyfloat(key,field,increment)-instance-method","html_id":"hincrbyfloat(key,field,increment)-instance-method","name":"hincrbyfloat","doc":"Increment the specified field of an hash stored at key,\nand representing a floating point number, by the specified increment.\n\n**Return value**: String, the value at field after the increment operation.","summary":"

    Increment the specified field of an hash stored at key, and representing a floating point number, by the specified increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, field, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1030","def":{"name":"hincrbyfloat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"HINCRBYFLOAT\", key.to_s, field.to_s, increment.to_s])"}},{"id":"hkeys(key)-instance-method","html_id":"hkeys(key)-instance-method","name":"hkeys","doc":"Returns all field names in the hash stored at key.\n\n**Return value**: Array(String) - list of fields in the hash, or an empty list when key does not exist.","summary":"

    Returns all field names in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1037","def":{"name":"hkeys","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HKEYS\", key.to_s])"}},{"id":"hlen(key)-instance-method","html_id":"hlen(key)-instance-method","name":"hlen","doc":"Returns the number of fields contained in the hash stored at key.\n\n**Return value**: Integer, the number of fields in the hash, or 0 when key does not exist.","summary":"

    Returns the number of fields contained in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1044","def":{"name":"hlen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HLEN\", key.to_s])"}},{"id":"hmget(key,*fields:String):Array(RedisValue)-instance-method","html_id":"hmget(key,*fields:String):Array(RedisValue)-instance-method","name":"hmget","doc":"Returns the values associated with the specified fields in the hash stored at key.\n\n**Return value**: Array(RedisValue), the list of values associated with the given fields, in the same order as they are requested.","summary":"

    Returns the values associated with the specified fields in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":"String"}],"args_string":"(key, *fields : String) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1056","def":{"name":"hmget","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"hmget(key, fields.to_a)"}},{"id":"hmget(key,fields:Array(String)):Array(RedisValue)-instance-method","html_id":"hmget(key,fields:Array(String)):Array(RedisValue)-instance-method","name":"hmget","doc":"Returns the values associated with the specified fields in the hash stored at key.\n\n**Return value**: Array(RedisValue), the list of values associated with the given fields, in the same order as they are requested.","summary":"

    Returns the values associated with the specified fields in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":"Array(String)"}],"args_string":"(key, fields : Array(String)) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1051","def":{"name":"hmget","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"string_array_command(concat([\"HMGET\", key.to_s], fields))"}},{"id":"hmset(key,hash)-instance-method","html_id":"hmset(key,hash)-instance-method","name":"hmset","doc":"Sets the specified fields to their respective values in the hash stored at key.\n\n**Return value**: \"OK\"","summary":"

    Sets the specified fields to their respective values in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"args_string":"(key, hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1063","def":{"name":"hmset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"HMSET\", key.to_s] of RedisValue\nhash.each do |field, value|\n (q << field.to_s) << value.to_s\nend\nstring_command(q)\n"}},{"id":"hscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"hscan(key,cursor,match=nil,count=nil)-instance-method","name":"hscan","doc":"```\nredis.hscan(\"myhash\", 0)\nredis.hscan(\"myhash\", 0, \"foo*\")\nredis.hscan(\"myhash\", 0, \"foo*\", 1024)\n```","summary":"

    ` redis.hscan(\"myhash\", 0) redis.hscan(\"myhash\", 0, \"foo\") redis.hscan(\"myhash\", 0, \"foo\", 1024) `

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1083","def":{"name":"hscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"HSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"hset(key,field,value)-instance-method","html_id":"hset(key,field,value)-instance-method","name":"hset","doc":"Sets field in the hash stored at key to value.\n\n**Return value**: Integer, specifically:\n* 1 if field is a new field in the hash and value was set.\n* 0 if field already exists in the hash and the value was updated.\n\nExample:\n\n```\nredis.hset(\"myhash\", \"a\", \"434\")\n```","summary":"

    Sets field in the hash stored at key to value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, field, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L971","def":{"name":"hset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HSET\", key.to_s, field.to_s, value.to_s])"}},{"id":"hsetnx(key,field,value)-instance-method","html_id":"hsetnx(key,field,value)-instance-method","name":"hsetnx","doc":"Sets field in the hash stored at key to value, only if field does not yet exist.\n\n**Return value**: Integer, specifically:\n* 1 if field is a new field in the hash and value was set.\n* 0 if field already exists in the hash and no operation was performed.","summary":"

    Sets field in the hash stored at key to value, only if field does not yet exist.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, field, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1095","def":{"name":"hsetnx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HSETNX\", key.to_s, field.to_s, value.to_s])"}},{"id":"hvals(key)-instance-method","html_id":"hvals(key)-instance-method","name":"hvals","doc":"Returns all values in the hash stored at key.\n\n**Return value**: Array(String), the list of values in the hash, or an empty list when key does not exist.","summary":"

    Returns all values in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1102","def":{"name":"hvals","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HVALS\", key.to_s])"}},{"id":"incr(key)-instance-method","html_id":"incr(key)-instance-method","name":"incr","doc":"Increments the number stored at key by one.\n\n**Return value**: Integer: the value of key after the increment\n\nExample:\n\n```\nredis.set(\"foo\", \"3\")\nredis.incr(\"foo\") # => 4\n```","summary":"

    Increments the number stored at key by one.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L312","def":{"name":"incr","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"INCR\", key.to_s])"}},{"id":"incrby(key,increment)-instance-method","html_id":"incrby(key,increment)-instance-method","name":"incrby","doc":"Increments the number stored at key by increment.\n\n**Return value**: Integer, the value of key after the increment\n\nExample:\n\n```\nredis.incrby(\"foo\", 4)\n```","summary":"

    Increments the number stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L332","def":{"name":"incrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"INCRBY\", key.to_s, increment.to_s])"}},{"id":"incrbyfloat(key,increment)-instance-method","html_id":"incrbyfloat(key,increment)-instance-method","name":"incrbyfloat","doc":"Increment the string representing a floating point number stored at key by the specified increment.\n\n**Return value**: Integer, the value of key after the increment\n\nExample:\n\n```\nredis.incrbyfloat(\"foo\", 2.5)\n```","summary":"

    Increment the string representing a floating point number stored at key by the specified increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L345","def":{"name":"incrbyfloat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"INCRBYFLOAT\", key.to_s, increment.to_s])"}},{"id":"info(section:String?=nil)-instance-method","html_id":"info(section:String?=nil)-instance-method","name":"info","doc":"The INFO command returns information and statistics about the server.\n\n**Return value**: A hash with the server information","summary":"

    The INFO command returns information and statistics about the server.

    ","abstract":false,"args":[{"name":"section","doc":null,"default_value":"nil","external_name":"section","restriction":"String | ::Nil"}],"args_string":"(section : String? = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1754","def":{"name":"info","args":[{"name":"section","doc":null,"default_value":"nil","external_name":"section","restriction":"String | ::Nil"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"arr = [\"INFO\"]\nif section\n arr << section\nend\nbulk = string_command(arr)\nresults = Hash(String, String).new\n(bulk.split(\"\\r\\n\")).each do |line|\n if line.empty? || (line[0] == '#')\n next\n end\n key, val = line.split(\":\")\n results[key] = val\nend\nresults\n"}},{"id":"keys(pattern)-instance-method","html_id":"keys(pattern)-instance-method","name":"keys","doc":"Returns all keys matching pattern.\n\n**Return value**: Array(String), array of keys matching pattern.\n\nExample:\n\n```\nredis.keys(\"callmemaybe\")\n```","summary":"

    Returns all keys matching pattern.

    ","abstract":false,"args":[{"name":"pattern","doc":null,"default_value":"","external_name":"pattern","restriction":""}],"args_string":"(pattern)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L558","def":{"name":"keys","args":[{"name":"pattern","doc":null,"default_value":"","external_name":"pattern","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"KEYS\", pattern.to_s])"}},{"id":"lindex(key,index)-instance-method","html_id":"lindex(key,index)-instance-method","name":"lindex","doc":"Returns the element at index index in the list stored at key.\n\n**Return value**: String, the requested element, or nil when index is out of range.","summary":"

    Returns the element at index index in the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"args_string":"(key, index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L629","def":{"name":"lindex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"LINDEX\", key.to_s, index.to_s])"}},{"id":"linsert(key,where,pivot,value)-instance-method","html_id":"linsert(key,where,pivot,value)-instance-method","name":"linsert","doc":"Inserts value in the list stored at key either before or after the reference value pivot.\n\n**Options**:\n\n* where - either \"BEFORE\" or \"AFTER\"\n\n**Return value**: Integer, the length of the list after the insert operation, or -1 when the value pivot was not found.","summary":"

    Inserts value in the list stored at key either before or after the reference value pivot.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"where","doc":null,"default_value":"","external_name":"where","restriction":""},{"name":"pivot","doc":null,"default_value":"","external_name":"pivot","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, where, pivot, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L667","def":{"name":"linsert","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"where","doc":null,"default_value":"","external_name":"where","restriction":""},{"name":"pivot","doc":null,"default_value":"","external_name":"pivot","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LINSERT\", key.to_s, where.to_s, pivot.to_s, value.to_s])"}},{"id":"llen(key)-instance-method","html_id":"llen(key)-instance-method","name":"llen","doc":"Returns the length of the list stored at key.\n\n**Return value**: Integer, the length of the list at key.","summary":"

    Returns the length of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L622","def":{"name":"llen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LLEN\", key.to_s])"}},{"id":"lpop(key)-instance-method","html_id":"lpop(key)-instance-method","name":"lpop","doc":"Removes and returns the first element of the list stored at key.\n\n**Return value**: String, the value of the first element, or nil when key does not exist.\n\nExample:\n\n```\nredis.lpop(\"mylist\")\n```","summary":"

    Removes and returns the first element of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L649","def":{"name":"lpop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"LPOP\", key.to_s])"}},{"id":"lpush(key,*values)-instance-method","html_id":"lpush(key,*values)-instance-method","name":"lpush","doc":"Insert all the specified values at the head of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Insert all the specified values at the head of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L583","def":{"name":"lpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"lpush(key, values.to_a)"}},{"id":"lpush(key,values:Array(RedisValue))-instance-method","html_id":"lpush(key,values:Array(RedisValue))-instance-method","name":"lpush","doc":"Insert all the specified values at the head of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Insert all the specified values at the head of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L588","def":{"name":"lpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"LPUSH\", key.to_s], values))"}},{"id":"lpushx(key,value)-instance-method","html_id":"lpushx(key,value)-instance-method","name":"lpushx","doc":"Inserts value at the head of the list stored at key, only if key already exists and holds a list.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Inserts value at the head of the list stored at key, only if key already exists and holds a list.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L595","def":{"name":"lpushx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LPUSHX\", key.to_s, value.to_s])"}},{"id":"lrange(key,from,to)-instance-method","html_id":"lrange(key,from,to)-instance-method","name":"lrange","doc":"Returns the specified elements of the list stored at key.\n\n**Return value**: Array(String), the list of elements in the specified range.\n\nExample:\n\n```\nredis.lrange(\"mylist\", 0, 2)\n```","summary":"

    Returns the specified elements of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"","external_name":"to","restriction":""}],"args_string":"(key, from, to)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L680","def":{"name":"lrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"LRANGE\", key.to_s, from.to_s, to.to_s])"}},{"id":"lrem(key,count,value)-instance-method","html_id":"lrem(key,count,value)-instance-method","name":"lrem","doc":"Removes the first count occurrences of elements equal to value from the list stored at key.\n\n**Return value**: Integer, the number of removed elements.\n\nExample:\n\n```\nredis.lrem(\"mylist\", 1, \"my\")\n```","summary":"

    Removes the first count occurrences of elements equal to value from the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"","external_name":"count","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, count, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L615","def":{"name":"lrem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"","external_name":"count","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LREM\", key.to_s, count.to_s, value.to_s])"}},{"id":"lset(key,index,value)-instance-method","html_id":"lset(key,index,value)-instance-method","name":"lset","doc":"Sets the list element at index to value.\n\n**Return value**: \"OK\"","summary":"

    Sets the list element at index to value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L636","def":{"name":"lset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"LSET\", key.to_s, index.to_s, value.to_s])"}},{"id":"ltrim(key,start,stop)-instance-method","html_id":"ltrim(key,start,stop)-instance-method","name":"ltrim","doc":"Trim an existing list so that it will contain only the specified range of elements specified.\n\n**Return value**: \"OK\"","summary":"

    Trim an existing list so that it will contain only the specified range of elements specified.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L687","def":{"name":"ltrim","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"LTRIM\", key.to_s, start.to_s, stop.to_s])"}},{"id":"mget(keys:Array(String)):Array(RedisValue)-instance-method","html_id":"mget(keys:Array(String)):Array(RedisValue)-instance-method","name":"mget","doc":null,"summary":null,"abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String)) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L223","def":{"name":"mget","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"string_array_command(concat([\"MGET\"], keys))"}},{"id":"mget(*keys)-instance-method","html_id":"mget(*keys)-instance-method","name":"mget","doc":"Returns the values of all specified keys.\n\n**Return value**: Array(String), the list of values at the specified keys.\nFor every key that does not hold a string value or does not exist, nil is returned.\n\nExample:\n\n```\nredis.set(\"foo1\", \"test1\")\nredis.set(\"foo2\", \"test2\")\nredis.mget(\"foo1\", \"foo2\") # => [\"test1\", \"test2\"]\n```","summary":"

    Returns the values of all specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L219","def":{"name":"mget","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"MGET\"], keys))"}},{"id":"mset(hash:Hash)-instance-method","html_id":"mset(hash:Hash)-instance-method","name":"mset","doc":"Sets the given keys to their respective values as defined in the hash.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.mset({\"foo1\": \"bar1\", \"foo2\": \"bar2\"})\n```","summary":"

    Sets the given keys to their respective values as defined in the hash.

    ","abstract":false,"args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":"Hash"}],"args_string":"(hash : Hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L236","def":{"name":"mset","args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":"Hash"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"MSET\"] of RedisValue\nhash.each do |key, value|\n (q << key.to_s) << value.to_s\nend\nstring_command(q)\n"}},{"id":"msetnx(hash)-instance-method","html_id":"msetnx(hash)-instance-method","name":"msetnx","doc":"Sets the given keys to their respective values as defined in the hash.\nMSETNX will not perform any operation at all even if just a single key already exists.\n\n**Return value**: Integer, specifically:\n* 1 if the all the keys were set.\n* 0 if no key was set (at least one key already existed).\n\nExample:\n\n```\nredis.msetnx({\"key1\": \"hello\", \"key2\": \"there\"})\n```","summary":"

    Sets the given keys to their respective values as defined in the hash.

    ","abstract":false,"args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"args_string":"(hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L296","def":{"name":"msetnx","args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"MSETNX\"] of RedisValue\nhash.each do |key, value|\n (q << key.to_s) << value\nend\ninteger_command(q)\n"}},{"id":"object_encoding(key)-instance-method","html_id":"object_encoding(key)-instance-method","name":"object_encoding","doc":"Returns the kind of internal representation used in order to store\nthe value associated with a key.\n\n**Return value**: String: returns the kind of internal representation\nused in order to store the value associated with a key.","summary":"

    Returns the kind of internal representation used in order to store the value associated with a key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1781","def":{"name":"object_encoding","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"OBJECT\", \"ENCODING\", key.to_s])"}},{"id":"object_idletime(key)-instance-method","html_id":"object_idletime(key)-instance-method","name":"object_idletime","doc":"Returns the number of seconds since the object stored at the specified key\nis idle (not requested by read or write operations).\n\n**Return value**: Integer: returns the number of seconds\nsince the object stored at the specified key is idle\n(not requested by read or write operations).","summary":"

    Returns the number of seconds since the object stored at the specified key is idle (not requested by read or write operations).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1791","def":{"name":"object_idletime","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"OBJECT\", \"IDLETIME\", key.to_s])"}},{"id":"object_refcount(key)-instance-method","html_id":"object_refcount(key)-instance-method","name":"object_refcount","doc":"Returns the number of references of the value associated\nwith the specified key.\n\n**Return value**: Integer: returns the number of references\nof the value associated with the specified key.","summary":"

    Returns the number of references of the value associated with the specified key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1772","def":{"name":"object_refcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"OBJECT\", \"REFCOUNT\", key.to_s])"}},{"id":"persist(key)-instance-method","html_id":"persist(key)-instance-method","name":"persist","doc":"Remove the existing timeout on key, turning the key from volatile\n(a key with an expire set) to persistent (a key that will never expire\nas no timeout is associated).\n\n**Return value**: Integer, specifically:\n* 1 if the timeout was removed.\n* 0 if key does not exist or does not have an associated timeout.","summary":"

    Remove the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1575","def":{"name":"persist","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PERSIST\", key.to_s])"}},{"id":"pexpire(key,milis)-instance-method","html_id":"pexpire(key,milis)-instance-method","name":"pexpire","doc":"This command works exactly like EXPIRE but the time to live of the key is\nspecified in milliseconds instead of seconds.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"milis","doc":null,"default_value":"","external_name":"milis","restriction":""}],"args_string":"(key, milis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1543","def":{"name":"pexpire","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"milis","doc":null,"default_value":"","external_name":"milis","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PEXPIRE\", key.to_s, milis.to_s])"}},{"id":"pexpireat(key,unix_date_in_millis)-instance-method","html_id":"pexpireat(key,unix_date_in_millis)-instance-method","name":"pexpireat","doc":"PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time\nat which the key will expire is specified in milliseconds instead of seconds.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time at which the key will expire is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date_in_millis","doc":null,"default_value":"","external_name":"unix_date_in_millis","restriction":""}],"args_string":"(key, unix_date_in_millis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1564","def":{"name":"pexpireat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date_in_millis","doc":null,"default_value":"","external_name":"unix_date_in_millis","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PEXPIREAT\", key.to_s, unix_date_in_millis.to_s])"}},{"id":"pfadd(key,*values:String):Int64-instance-method","html_id":"pfadd(key,*values:String):Int64-instance-method","name":"pfadd","doc":"Adds all the element arguments to the HyperLogLog data structure stored at\nthe variable name specified as first argument.\n\n**Return value**: Integer: 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.\n\nExample:\n\n```\nredis.pfadd(\"hll\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\") # => 1\n```","summary":"

    Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"String"}],"args_string":"(key, *values : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1416","def":{"name":"pfadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"pfadd(key, values.to_a)"}},{"id":"pfadd(key,values:Array(String)):Int64-instance-method","html_id":"pfadd(key,values:Array(String)):Int64-instance-method","name":"pfadd","doc":"Adds all the element arguments to the HyperLogLog data structure stored at\nthe variable name specified as first argument.\n\n**Return value**: Integer: 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.\n\nExample:\n\n```\nredis.pfadd(\"hll\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\") # => 1\n```","summary":"

    Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(String)"}],"args_string":"(key, values : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1411","def":{"name":"pfadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"PFADD\", key.to_s], values))"}},{"id":"pfcount(keys:Array(String)):Int64-instance-method","html_id":"pfcount(keys:Array(String)):Int64-instance-method","name":"pfcount","doc":"When called with a single key, returns the approximated cardinality computed\nby the HyperLogLog data structure stored at the specified variable,\nwhich is 0 if the variable does not exist.\n\n**Return value**: Integer, the approximated number of unique elements\nobserved via PFADD.","summary":"

    When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1438","def":{"name":"pfcount","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"PFCOUNT\"], keys))"}},{"id":"pfcount(*keys:String):Int64-instance-method","html_id":"pfcount(*keys:String):Int64-instance-method","name":"pfcount","doc":"When called with a single key, returns the approximated cardinality computed\nby the HyperLogLog data structure stored at the specified variable,\nwhich is 0 if the variable does not exist.\n\n**Return value**: Integer, the approximated number of unique elements\nobserved via PFADD.","summary":"

    When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(*keys : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1443","def":{"name":"pfcount","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"pfcount(keys.to_a)"}},{"id":"pfmerge(keys:Array(String))-instance-method","html_id":"pfmerge(keys:Array(String))-instance-method","name":"pfmerge","doc":"Merge multiple HyperLogLog values into an unique value that will\napproximate the cardinality of the union of the observed Sets of the\nsource HyperLogLog structures.","summary":"

    Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1423","def":{"name":"pfmerge","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command(concat([\"PFMERGE\"], keys))"}},{"id":"pfmerge(*keys:String)-instance-method","html_id":"pfmerge(*keys:String)-instance-method","name":"pfmerge","doc":"Merge multiple HyperLogLog values into an unique value that will\napproximate the cardinality of the union of the observed Sets of the\nsource HyperLogLog structures.","summary":"

    Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(*keys : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1428","def":{"name":"pfmerge","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"pfmerge(keys.to_a)"}},{"id":"ping-instance-method","html_id":"ping-instance-method","name":"ping","doc":"Returns PONG. This command is often used to test if a connection is still alive, or to measure latency.\n\nExample:\n\n```\nredis.ping # => \"PONG\"\n```","summary":"

    Returns PONG.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L23","def":{"name":"ping","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"PING\"])"}},{"id":"psetex(key,expire_in_milis,value)-instance-method","html_id":"psetex(key,expire_in_milis,value)-instance-method","name":"psetex","doc":"PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.\n\n**Return value**: \"OK\"","summary":"

    PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_milis","doc":null,"default_value":"","external_name":"expire_in_milis","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, expire_in_milis, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L271","def":{"name":"psetex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_milis","doc":null,"default_value":"","external_name":"expire_in_milis","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"PSETEX\", key.to_s, expire_in_milis.to_s, value.to_s])"}},{"id":"psubscribe(*channel_patterns)-instance-method","html_id":"psubscribe(*channel_patterns)-instance-method","name":"psubscribe","doc":null,"summary":null,"abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1693","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"psubscribe(channel_patterns.to_a)"}},{"id":"psubscribe(channel_patterns:Array(String))-instance-method","html_id":"psubscribe(channel_patterns:Array(String))-instance-method","name":"psubscribe","doc":"Subscribes to more channel patterns while already being in a subscription loop.","summary":"

    Subscribes to more channel patterns while already being in a subscription loop.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":"Array(String)"}],"args_string":"(channel_patterns : Array(String))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1684","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\nelse\n raise(Redis::Error.new(\"Must call psubscribe with a subscription block\"))\nend\nvoid_command(concat([\"PSUBSCRIBE\"], channel_patterns))\n"}},{"id":"psubscribe(*channel_patterns,&callback_setup_block:Subscription->)-instance-method","html_id":"psubscribe(*channel_patterns,&callback_setup_block:Subscription->)-instance-method","name":"psubscribe","doc":"Subscribes to channel patterns and enters a subscription loop, waiting for events.\n\nThe method yields to the given block and passes a Subscription object, on\nwhich you can set your callbacks for the event subscription.\n\nThe subscription loop will end once you unsubscribe.","summary":"

    Subscribes to channel patterns and enters a subscription loop, waiting for events.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns, &callback_setup_block : Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1668","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Subscription -> )"},"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\n raise(Redis::Error.new(\"Must call psubscribe without a subscription block when inside a subscription loop\"))\nend\nsubscription = Subscription.new\ncallback_setup_block.call(subscription)\n@strategy = Redis::Strategy::SubscriptionLoop.new(connection, subscription)\npsubscribe(*channel_patterns)\n"}},{"id":"pttl(key)-instance-method","html_id":"pttl(key)-instance-method","name":"pttl","doc":"Like TTL this command returns the remaining time to live of a key that has\nan expire set, with the sole difference that TTL returns the amount of\nremaining time in seconds while PTTL returns it in milliseconds.\n\n**Return value**: Integer, the TTL in milliseconds, or a negative value in order to signal an error.","summary":"

    Like TTL this command returns the remaining time to live of a key that has an expire set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1592","def":{"name":"pttl","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PTTL\", key.to_s])"}},{"id":"publish(channel,message)-instance-method","html_id":"publish(channel,message)-instance-method","name":"publish","doc":"Posts a message to the given channel.\n\n**Return value**: Integer, the number of clients that received the message.\n\nExample:\n\n```\nredis.publish(\"mychannel\", \"some message\")\n```","summary":"

    Posts a message to the given channel.

    ","abstract":false,"args":[{"name":"channel","doc":null,"default_value":"","external_name":"channel","restriction":""},{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"args_string":"(channel, message)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1729","def":{"name":"publish","args":[{"name":"channel","doc":null,"default_value":"","external_name":"channel","restriction":""},{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PUBLISH\", channel.to_s, message.to_s])"}},{"id":"punsubscribe(*channel_patterns)-instance-method","html_id":"punsubscribe(*channel_patterns)-instance-method","name":"punsubscribe","doc":"Unsubscribes the client from the given patterns, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given patterns, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1716","def":{"name":"punsubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"punsubscribe(channel_patterns.to_a)"}},{"id":"punsubscribe(channel_patterns:Array(String))-instance-method","html_id":"punsubscribe(channel_patterns:Array(String))-instance-method","name":"punsubscribe","doc":"Unsubscribes the client from the given patterns, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given patterns, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":"Array(String)"}],"args_string":"(channel_patterns : Array(String))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1711","def":{"name":"punsubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"void_command(concat([\"PUNSUBSCRIBE\"], channel_patterns))"}},{"id":"quit-instance-method","html_id":"quit-instance-method","name":"quit","doc":"Ask the server to close the connection. The connection is closed as soon as all pending replies have been written to the client.\n\n**Return value**: \"OK\"","summary":"

    Ask the server to close the connection.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L73","def":{"name":"quit","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"QUIT\"])"}},{"id":"randomkey-instance-method","html_id":"randomkey-instance-method","name":"randomkey","doc":"Return a random key from the currently selected database.","summary":"

    Return a random key from the currently selected database.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L536","def":{"name":"randomkey","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"RANDOMKEY\"])"}},{"id":"rename(old_key,new_key)-instance-method","html_id":"rename(old_key,new_key)-instance-method","name":"rename","doc":"Renames old_key to newkey.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.rename(\"old_name\", \"new_name\")\n```","summary":"

    Renames old_key to newkey.

    ","abstract":false,"args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"args_string":"(old_key, new_key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L107","def":{"name":"rename","args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"RENAME\", old_key.to_s, new_key.to_s])"}},{"id":"renamenx(old_key,new_key)-instance-method","html_id":"renamenx(old_key,new_key)-instance-method","name":"renamenx","doc":"Renames old_key to newkey if newkey does not yet exist.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.renamenx(\"old_name\", \"new_name\")\n```","summary":"

    Renames old_key to newkey if newkey does not yet exist.

    ","abstract":false,"args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"args_string":"(old_key, new_key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L120","def":{"name":"renamenx","args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"RENAMENX\", old_key.to_s, new_key.to_s])"}},{"id":"restore(key,ttl_in_milis:Int,serialized_value:String,replace=false)-instance-method","html_id":"restore(key,ttl_in_milis:Int,serialized_value:String,replace=false)-instance-method","name":"restore","doc":"Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP).\n\n**Return value**: The command returns \"OK\" on success.","summary":"

    Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"ttl_in_milis","doc":null,"default_value":"","external_name":"ttl_in_milis","restriction":"Int"},{"name":"serialized_value","doc":null,"default_value":"","external_name":"serialized_value","restriction":"String"},{"name":"replace","doc":null,"default_value":"false","external_name":"replace","restriction":""}],"args_string":"(key, ttl_in_milis : Int, serialized_value : String, replace = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L504","def":{"name":"restore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"ttl_in_milis","doc":null,"default_value":"","external_name":"ttl_in_milis","restriction":"Int"},{"name":"serialized_value","doc":null,"default_value":"","external_name":"serialized_value","restriction":"String"},{"name":"replace","doc":null,"default_value":"false","external_name":"replace","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"RESTORE\", key.to_s, ttl_in_milis.to_s, serialized_value]\nif replace\n q << \"REPLACE\"\nend\nstring_command(q)\n"}},{"id":"rpop(key)-instance-method","html_id":"rpop(key)-instance-method","name":"rpop","doc":"Removes and returns the last element of the list stored at key.\n\n**Return value**: \"OK\"","summary":"

    Removes and returns the last element of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L656","def":{"name":"rpop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"RPOP\", key.to_s])"}},{"id":"rpoplpush(source,destination)-instance-method","html_id":"rpoplpush(source,destination)-instance-method","name":"rpoplpush","doc":"Atomically returns and removes the last element (tail) of the list stored at source,\nand pushes the element at the first element (head) of the list stored at destination.\n\n**Return value**: String, the element being popped and pushed.","summary":"

    Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""}],"args_string":"(source, destination)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L931","def":{"name":"rpoplpush","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"RPOPLPUSH\", source.to_s, destination.to_s])"}},{"id":"rpush(key,*values:String)-instance-method","html_id":"rpush(key,*values:String)-instance-method","name":"rpush","doc":"Insert all the specified values at the tail of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.\n\nExample:\n\n```\nredis.rpush(\"mylist\", \"1\", \"2\", \"3\")\n```","summary":"

    Insert all the specified values at the tail of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"String"}],"args_string":"(key, *values : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L576","def":{"name":"rpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"rpush(key, values.to_a)"}},{"id":"rpush(key,values:Array(RedisValue))-instance-method","html_id":"rpush(key,values:Array(RedisValue))-instance-method","name":"rpush","doc":"Insert all the specified values at the tail of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.\n\nExample:\n\n```\nredis.rpush(\"mylist\", \"1\", \"2\", \"3\")\n```","summary":"

    Insert all the specified values at the tail of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L571","def":{"name":"rpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"RPUSH\", key.to_s], values))"}},{"id":"rpushx(key,value)-instance-method","html_id":"rpushx(key,value)-instance-method","name":"rpushx","doc":"Inserts value at the tail of the list stored at key, only if key already exists and holds a list.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Inserts value at the tail of the list stored at key, only if key already exists and holds a list.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L602","def":{"name":"rpushx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"RPUSHX\", key.to_s, value.to_s])"}},{"id":"sadd(key,*values)-instance-method","html_id":"sadd(key,*values)-instance-method","name":"sadd","doc":"Add the specified members to the set stored at key.\n\n**Return value**: Integer, the number of elements that were added to the set, not including all the elements already present into the set.","summary":"

    Add the specified members to the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L694","def":{"name":"sadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"sadd(key, values.to_a)"}},{"id":"sadd(key,values:Array(RedisValue))-instance-method","html_id":"sadd(key,values:Array(RedisValue))-instance-method","name":"sadd","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L698","def":{"name":"sadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SADD\", key.to_s], values))"}},{"id":"scan(cursor,match=nil,count=nil)-instance-method","html_id":"scan(cursor,match=nil,count=nil)-instance-method","name":"scan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array of String, a list of keys.\n\nExample:\n\n```\nredis.scan(0)\nredis.scan(0, \"foo*\")\nredis.scan(0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L528","def":{"name":"scan","args":[{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SCAN\", cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"scard(key)-instance-method","html_id":"scard(key)-instance-method","name":"scard","doc":"Returns the set cardinality (number of elements) of the set stored at key.","summary":"

    Returns the set cardinality (number of elements) of the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L736","def":{"name":"scard","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SCARD\", key.to_s])"}},{"id":"script_exists(sha1_array:Array(Reference))-instance-method","html_id":"script_exists(sha1_array:Array(Reference))-instance-method","name":"script_exists","doc":"Returns information about the existence of the scripts in the script cache.\n\n**Return value**: The command returns an array of integers that correspond\nto the specified SHA1 digest arguments.\nFor every corresponding SHA1 digest of a script that actually exists\nin the script cache, an 1 is returned, otherwise 0 is returned.","summary":"

    Returns information about the existence of the scripts in the script cache.

    ","abstract":false,"args":[{"name":"sha1_array","doc":null,"default_value":"","external_name":"sha1_array","restriction":"Array(Reference)"}],"args_string":"(sha1_array : Array(Reference))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1497","def":{"name":"script_exists","args":[{"name":"sha1_array","doc":null,"default_value":"","external_name":"sha1_array","restriction":"Array(Reference)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_array_command(concat([\"SCRIPT\", \"EXISTS\"], sha1_array))"}},{"id":"script_flush-instance-method","html_id":"script_flush-instance-method","name":"script_flush","doc":"Flush the Lua scripts cache.\n\n**Return value**: \"OK\"","summary":"

    Flush the Lua scripts cache.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1518","def":{"name":"script_flush","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"FLUSH\"])"}},{"id":"script_kill-instance-method","html_id":"script_kill-instance-method","name":"script_kill","doc":"Kills the currently executing Lua script, assuming no write operation was\nyet performed by the script.\n\n**Return value**: \"OK\"","summary":"

    Kills the currently executing Lua script, assuming no write operation was yet performed by the script.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1487","def":{"name":"script_kill","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"KILL\"])"}},{"id":"script_load(script:String)-instance-method","html_id":"script_load(script:String)-instance-method","name":"script_load","doc":"Load a script into the scripts cache, without executing it.\n\n**Return value**: String, the SHA1 digest of the script\nadded into the script cache.\n\nExample:\n\n```\nredis.script_load(\"return {KEYS[1],ARGV[1]}\") # => \"a191862bfe0bd3bec995befcd060582bf4bdbd77\"\n```","summary":"

    Load a script into the scripts cache, without executing it.

    ","abstract":false,"args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"}],"args_string":"(script : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1479","def":{"name":"script_load","args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"LOAD\", script])"}},{"id":"sdiff(keys:Array(String)):Array(RedisValue)-instance-method","html_id":"sdiff(keys:Array(String)):Array(RedisValue)-instance-method","name":"sdiff","doc":"Returns the members of the set resulting from the difference between the first set and all the successive sets.\n\n**Return value**: Array(String), a list with members of the resulting set.","summary":"

    Returns the members of the set resulting from the difference between the first set and all the successive sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String)) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L743","def":{"name":"sdiff","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"string_array_command(concat([\"SDIFF\"], keys))"}},{"id":"sdiff(*keys:String):Array(RedisValue)-instance-method","html_id":"sdiff(*keys:String):Array(RedisValue)-instance-method","name":"sdiff","doc":null,"summary":null,"abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(*keys : String) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L747","def":{"name":"sdiff","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"sdiff(keys.to_a)"}},{"id":"sdiffstore(destination,*keys:String):Int64-instance-method","html_id":"sdiffstore(destination,*keys:String):Int64-instance-method","name":"sdiffstore","doc":"This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(destination, *keys : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L759","def":{"name":"sdiffstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"sdiffstore(destination, keys.to_a)"}},{"id":"sdiffstore(destination,keys:Array(String)):Int64-instance-method","html_id":"sdiffstore(destination,keys:Array(String)):Int64-instance-method","name":"sdiffstore","doc":"This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(destination, keys : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L754","def":{"name":"sdiffstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"SDIFFSTORE\", destination.to_s], keys))"}},{"id":"select(database_number)-instance-method","html_id":"select(database_number)-instance-method","name":"select","doc":"Select the DB with having the specified zero-based numeric index.\n\n**Return value**: \"OK\"","summary":"

    Select the DB with having the specified zero-based numeric index.

    ","abstract":false,"args":[{"name":"database_number","doc":null,"default_value":"","external_name":"database_number","restriction":""}],"args_string":"(database_number)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L94","def":{"name":"select","args":[{"name":"database_number","doc":null,"default_value":"","external_name":"database_number","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SELECT\", database_number.to_s])"}},{"id":"set(key,value,ex=nil,px=nil,nx=nil,xx=nil)-instance-method","html_id":"set(key,value,ex=nil,px=nil,nx=nil,xx=nil)-instance-method","name":"set","doc":"Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type. Any previous time to live associated with the key is discarded on successful SET operation.\n\n**Options**:\n\n* Starting with Redis 2.6.12 SET supports a set of options that modify its behavior:\n* ex -- Set the specified expire time, in seconds.\n* px -- Set the specified expire time, in milliseconds.\n* nx -- Only set the key if it does not already exist.\n* xx -- Only set the key if it already exist.\n\n**Return value**:\n* OK if SET was executed correctly.\n* Null reply: nil is returned if the SET operation was not performed because the user specified the NX or XX option but the condition was not met.\n\nExample:\n\n```\nredis.set(\"foo\", \"test\")\nredis.set(\"bar\", \"test\", ex: 7)\n```","summary":"

    Set key to hold the string value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""},{"name":"ex","doc":null,"default_value":"nil","external_name":"ex","restriction":""},{"name":"px","doc":null,"default_value":"nil","external_name":"px","restriction":""},{"name":"nx","doc":null,"default_value":"nil","external_name":"nx","restriction":""},{"name":"xx","doc":null,"default_value":"nil","external_name":"xx","restriction":""}],"args_string":"(key, value, ex = nil, px = nil, nx = nil, xx = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L47","def":{"name":"set","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""},{"name":"ex","doc":null,"default_value":"nil","external_name":"ex","restriction":""},{"name":"px","doc":null,"default_value":"nil","external_name":"px","restriction":""},{"name":"nx","doc":null,"default_value":"nil","external_name":"nx","restriction":""},{"name":"xx","doc":null,"default_value":"nil","external_name":"xx","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SET\", key.to_s, value.to_s]\nif ex\n (q << \"EX\") << ex.to_s\nend\nif px\n (q << \"PX\") << px.to_s\nend\nif nx\n (q << \"NX\") << nx.to_s\nend\nif xx\n (q << \"XX\") << xx.to_s\nend\nstring_or_nil_command(q)\n"}},{"id":"setbit(key,index,value)-instance-method","html_id":"setbit(key,index,value)-instance-method","name":"setbit","doc":"Sets or clears the bit at offset in the string value stored at key.\n\n**Return value**: Integer: the original bit value stored at offset.\n\nExample:\n\n```\nredis.setbit(\"mykey\", 7, 1)\n```","summary":"

    Sets or clears the bit at offset in the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L465","def":{"name":"setbit","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETBIT\", key.to_s, index.to_s, value.to_s])"}},{"id":"setex(key,expire_in_seconds,value)-instance-method","html_id":"setex(key,expire_in_seconds,value)-instance-method","name":"setex","doc":"Set key to hold the string value and set key to timeout after a given number of seconds.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.setex(\"foo\", 3, \"bar\")\n```","summary":"

    Set key to hold the string value and set key to timeout after a given number of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_seconds","doc":null,"default_value":"","external_name":"expire_in_seconds","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, expire_in_seconds, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L264","def":{"name":"setex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_seconds","doc":null,"default_value":"","external_name":"expire_in_seconds","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SETEX\", key.to_s, expire_in_seconds.to_s, value.to_s])"}},{"id":"setnx(key,value)-instance-method","html_id":"setnx(key,value)-instance-method","name":"setnx","doc":"Set key to hold string value if key does not exist.\n\n**Return value**: Integer, specifically:\n* 1 if the key was set\n* 0 if the key was not set","summary":"

    Set key to hold string value if key does not exist.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L280","def":{"name":"setnx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETNX\", key.to_s, value.to_s])"}},{"id":"setrange(key,start_index,value)-instance-method","html_id":"setrange(key,start_index,value)-instance-method","name":"setrange","doc":"Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.\n\n**Return value**: Integer, the length of the string after it was modified by the command.\n\nExample:\n\n```\nredis.setrange(\"foo\", 6, \"Redis\")\n```","summary":"

    Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, start_index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L400","def":{"name":"setrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETRANGE\", key.to_s, start_index.to_s, value.to_s])"}},{"id":"sinter(keys:Array(String)):Array(RedisValue)-instance-method","html_id":"sinter(keys:Array(String)):Array(RedisValue)-instance-method","name":"sinter","doc":"Returns the members of the set resulting from the intersection of all the given sets.\n\n**Return value**: Array(String), an array with members of the resulting set.","summary":"

    Returns the members of the set resulting from the intersection of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String)) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L766","def":{"name":"sinter","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"string_array_command(concat([\"SINTER\"], keys))"}},{"id":"sinter(*keys:String):Array(RedisValue)-instance-method","html_id":"sinter(*keys:String):Array(RedisValue)-instance-method","name":"sinter","doc":"Returns the members of the set resulting from the intersection of all the given sets.\n\n**Return value**: Array(String), an array with members of the resulting set.","summary":"

    Returns the members of the set resulting from the intersection of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(*keys : String) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L771","def":{"name":"sinter","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"sinter(keys.to_a)"}},{"id":"sinterstore(destination_key,*keys:String):Int64-instance-method","html_id":"sinterstore(destination_key,*keys:String):Int64-instance-method","name":"sinterstore","doc":"This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.\n\nExample:\n\n```\nredis.sinterstore(\"destination\", \"key1\", \"key2\")\n```","summary":"

    This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(destination_key, *keys : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L789","def":{"name":"sinterstore","args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"sinterstore(destination_key, keys.to_a)"}},{"id":"sinterstore(destination_key,keys:Array(String)):Int64-instance-method","html_id":"sinterstore(destination_key,keys:Array(String)):Int64-instance-method","name":"sinterstore","doc":"This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.\n\nExample:\n\n```\nredis.sinterstore(\"destination\", \"key1\", \"key2\")\n```","summary":"

    This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(destination_key, keys : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L784","def":{"name":"sinterstore","args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"SINTERSTORE\", destination_key.to_s], keys))"}},{"id":"sismember(key,value)-instance-method","html_id":"sismember(key,value)-instance-method","name":"sismember","doc":"Returns if member is a member of the set stored at key.\n\n**Return value**: Integer, specifically:\n* 1 if the element is a member of the set.\n* 0 if the element is not a member of the set, or if key does not exist.","summary":"

    Returns if member is a member of the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L714","def":{"name":"sismember","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SISMEMBER\", key.to_s, value.to_s])"}},{"id":"smembers(key)-instance-method","html_id":"smembers(key)-instance-method","name":"smembers","doc":"Returns all the members of the set value stored at key.\n\n**Return value**: Array(String), all elements of the set.","summary":"

    Returns all the members of the set value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L705","def":{"name":"smembers","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"SMEMBERS\", key.to_s])"}},{"id":"smove(source,destination,member)-instance-method","html_id":"smove(source,destination,member)-instance-method","name":"smove","doc":"Move member from the set at source to the set at destination.\n\n**Return value**: Integer, specifically:\n* 1 if the element is moved.\n* 0 if the element is not a member of source and no operation was performed.","summary":"

    Move member from the set at source to the set at destination.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(source, destination, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L798","def":{"name":"smove","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SMOVE\", source.to_s, destination.to_s, member.to_s])"}},{"id":"sort(key,by=nil,limit=nil,get:Array(RedisValue)?=nil,order="ASC",alpha=false,store=nil)-instance-method","html_id":"sort(key,by=nil,limit=nil,get:Array(RedisValue)?=nil,order=&quot;ASC&quot;,alpha=false,store=nil)-instance-method","name":"sort","doc":"Returns or stores the elements contained in the list, set or sorted set at key.\n\n**Options**:\n\n* by - pattern for sorting by external keys\n* limit - Array of 2 strings [offset, count]\n* get - pattern for retrieving external keys\n* order - either 'ASC' or 'DESC'\n* alpha - true to sort lexicographically\n* store - key of destination list to store the result in\n\n**Return value**: Array(String), the list of sorted elements.\n\nExample:\n\n```\nredis.sort(\"mylist\") # => [...]\nredis.sort(\"mylist\", order: \"DESC\") # => [...]\n```","summary":"

    Returns or stores the elements contained in the list, set or sorted set at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"by","doc":null,"default_value":"nil","external_name":"by","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"get","doc":null,"default_value":"nil","external_name":"get","restriction":"Array(RedisValue) | ::Nil"},{"name":"order","doc":null,"default_value":"\"ASC\"","external_name":"order","restriction":""},{"name":"alpha","doc":null,"default_value":"false","external_name":"alpha","restriction":""},{"name":"store","doc":null,"default_value":"nil","external_name":"store","restriction":""}],"args_string":"(key, by = nil, limit = nil, get : Array(RedisValue)? = nil, order = "ASC", alpha = false, store = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L169","def":{"name":"sort","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"by","doc":null,"default_value":"nil","external_name":"by","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"get","doc":null,"default_value":"nil","external_name":"get","restriction":"Array(RedisValue) | ::Nil"},{"name":"order","doc":null,"default_value":"\"ASC\"","external_name":"order","restriction":""},{"name":"alpha","doc":null,"default_value":"false","external_name":"alpha","restriction":""},{"name":"store","doc":null,"default_value":"nil","external_name":"store","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SORT\", key.to_s]\nif by\n (q << \"BY\") << by.to_s\nend\nif limit\n if limit.size != 2\n raise(Error.new(\"limit must be an array of 2 elements (offset, count)\"))\n end\n offset, count = limit\n ((q << \"LIMIT\") << offset.to_s) << count.to_s\nend\nif get\n get.each do |pattern|\n (q << \"GET\") << pattern\n end\nend\nif order\n _order = order.upcase\n if [\"ASC\", \"DESC\"].includes?(_order)\n else\n raise(Error.new(\"Bad order #{order}\"))\n end\n q << _order\nend\nif alpha\n q << \"ALPHA\"\nend\nif store\n (q << \"STORE\") << store.to_s\nend\nstring_array_or_integer_command(q)\n"}},{"id":"spop(key,count=nil)-instance-method","html_id":"spop(key,count=nil)-instance-method","name":"spop","doc":"Removes and returns one or more random elements from the set value store at key.\n\nThe count argument will be available in a later Redis version and is not available in 2.6, 2.8, 3.0\n\n**Return value**: The removed element, or nil when key does not exist.","summary":"

    Removes and returns one or more random elements from the set value store at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L807","def":{"name":"spop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SPOP\", key.to_s]\nif count\n q << count.to_s\nend\nstring_array_or_string_or_nil_command(q)\n"}},{"id":"srandmember(key,count=nil)-instance-method","html_id":"srandmember(key,count=nil)-instance-method","name":"srandmember","doc":"When called with just the key argument, return a random element from the set value stored at key.\n\n**Options**:\n\n* count - Starting from Redis version 2.6, when called with the additional count argument, return an array of count distinct elements if count is positive. If called with a negative count the behavior changes and the command is allowed to return the same element multiple times.\n\n**Return value**:\n* String: without the additional count argument the command returns a Bulk Reply with the randomly selected element, or nil when key does not exist.\n* Array: when the additional count argument is passed the command returns an array of elements, or an empty array when key does not exist.","summary":"

    When called with just the key argument, return a random element from the set value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L825","def":{"name":"srandmember","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SRANDMEMBER\", key.to_s]\nif count\n q << count.to_s\nend\nstring_array_or_string_or_nil_command(q)\n"}},{"id":"srem(key,values:Array(RedisValue))-instance-method","html_id":"srem(key,values:Array(RedisValue))-instance-method","name":"srem","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L731","def":{"name":"srem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SREM\", key.to_s], values))"}},{"id":"srem(key,*values)-instance-method","html_id":"srem(key,*values)-instance-method","name":"srem","doc":"Remove the specified members from the set stored at key.\n\n**Return value**: Integer, The number of members that were removed from the set, not including non existing members.\n\nExample:\n\n```\nredis.srem(\"myset\", \"Hello\")\n```","summary":"

    Remove the specified members from the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L727","def":{"name":"srem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"srem(key, values.to_a)"}},{"id":"sscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"sscan(key,cursor,match=nil,count=nil)-instance-method","name":"sscan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array(String), a list of Set members.\n\nExample:\n\n```\nredis.sscan(\"myset\", 0)\nredis.sscan(\"myset\", 0, \"foo*\")\nredis.sscan(\"myset\", 0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L849","def":{"name":"sscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"strlen(key)-instance-method","html_id":"strlen(key)-instance-method","name":"strlen","doc":"Returns the length of the string value stored at key.\n\n**Return value**: Integer, the length of the string at key, or 0 when key does not exist.","summary":"

    Returns the length of the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L373","def":{"name":"strlen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"STRLEN\", key.to_s])"}},{"id":"subscribe(channels:Array(String)):Void-instance-method","html_id":"subscribe(channels:Array(String)):Void-instance-method","name":"subscribe","doc":"Subscribes to more channels while already being in a subscription loop.","summary":"

    Subscribes to more channels while already being in a subscription loop.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"Array(String)"}],"args_string":"(channels : Array(String)) : Void","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1648","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Void","visibility":"Public","body":"if already_in_subscription_loop?\nelse\n raise(Redis::Error.new(\"Must call subscribe with a subscription block\"))\nend\nvoid_command(concat([\"SUBSCRIBE\"], channels))\n"}},{"id":"subscribe(*channels:String)-instance-method","html_id":"subscribe(*channels:String)-instance-method","name":"subscribe","doc":"Subscribes to more channels while already being in a subscription loop.","summary":"

    Subscribes to more channels while already being in a subscription loop.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"String"}],"args_string":"(*channels : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1658","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"subscribe(channels.to_a)"}},{"id":"subscribe(*channels,&callback_setup_block:Subscription->)-instance-method","html_id":"subscribe(*channels,&callback_setup_block:Subscription->)-instance-method","name":"subscribe","doc":"Subscribes to channels and enters a subscription loop, waiting for events.\n\nThe method yields to the given block and passes a Subscription object, on\nwhich you can set your callbacks for the event subscription.\n\nThe subscription loop will end once you unsubscribe.\n\nSee also: `Subscription` class\nSee also: Example `subscribe.cr`\n\nExample:\n\n```\nredis.subscribe(\"mychannel\") do |on|\n on.message do |channel, message|\n puts \"Received message: #{message}\"\n if message == \"goodbye pal\"\n redis.unsubscribe\n end\n end\nend\n```","summary":"

    Subscribes to channels and enters a subscription loop, waiting for events.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels, &callback_setup_block : Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1632","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Subscription -> )"},"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\n raise(Redis::Error.new(\"Must call subscribe without a subscription block when already inside a subscription loop\"))\nend\nsubscription = Subscription.new\ncallback_setup_block.call(subscription)\n@strategy = Redis::Strategy::SubscriptionLoop.new(connection, subscription)\nsubscribe(*channels)\n"}},{"id":"sunion(keys:Array(String))-instance-method","html_id":"sunion(keys:Array(String))-instance-method","name":"sunion","doc":"Returns the members of the set resulting from the union of all the given sets.\n\n**Return value**: Array(String), with members of the resulting set.","summary":"

    Returns the members of the set resulting from the union of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L859","def":{"name":"sunion","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"SUNION\"], keys))"}},{"id":"sunion(*keys:String)-instance-method","html_id":"sunion(*keys:String)-instance-method","name":"sunion","doc":"Returns the members of the set resulting from the union of all the given sets.\n\n**Return value**: Array(String), with members of the resulting set.","summary":"

    Returns the members of the set resulting from the union of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(*keys : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L864","def":{"name":"sunion","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"sunion(keys.to_a)"}},{"id":"sunionstore(destination,keys:Array(String)):Int64-instance-method","html_id":"sunionstore(destination,keys:Array(String)):Int64-instance-method","name":"sunionstore","doc":"This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(destination, keys : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L871","def":{"name":"sunionstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"SUNIONSTORE\", destination.to_s], keys))"}},{"id":"sunionstore(destination,*keys:String):Int64-instance-method","html_id":"sunionstore(destination,*keys:String):Int64-instance-method","name":"sunionstore","doc":"This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(destination, *keys : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L876","def":{"name":"sunionstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"sunionstore(destination, keys.to_a)"}},{"id":"ttl(key)-instance-method","html_id":"ttl(key)-instance-method","name":"ttl","doc":"Returns the remaining time to live of a key that has a timeout.\n\n**Return value**: Integer: TTL in seconds, or a negative value in order to\nsignal an error (see the description above).","summary":"

    Returns the remaining time to live of a key that has a timeout.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1583","def":{"name":"ttl","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"TTL\", key.to_s])"}},{"id":"type(key)-instance-method","html_id":"type(key)-instance-method","name":"type","doc":"Returns the string representation of the type of the value stored at key.\n\n**Return value**: String, the type of key, or none when key does not exist.\n\nExample:\n\n```\nredis.set(\"foo\", 3)\nredis.type(\"foo\") # => \"string\"\n```","summary":"

    Returns the string representation of the type of the value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1606","def":{"name":"type","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"TYPE\", key.to_s])"}},{"id":"unsubscribe(channels:Array(String)):Nil-instance-method","html_id":"unsubscribe(channels:Array(String)):Nil-instance-method","name":"unsubscribe","doc":"Unsubscribes the client from the given channels, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given channels, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"Array(String)"}],"args_string":"(channels : Array(String)) : Nil","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1701","def":{"name":"unsubscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Nil","visibility":"Public","body":"void_command(concat([\"UNSUBSCRIBE\"], channels))"}},{"id":"unsubscribe(*channels)-instance-method","html_id":"unsubscribe(*channels)-instance-method","name":"unsubscribe","doc":"Unsubscribes the client from the given channels, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given channels, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1706","def":{"name":"unsubscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"unsubscribe(channels.to_a)"}},{"id":"unwatch-instance-method","html_id":"unwatch-instance-method","name":"unwatch","doc":"Flushes all the previously watched keys for a transaction.\n\n**Return value**: \"OK\"","summary":"

    Flushes all the previously watched keys for a transaction.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1747","def":{"name":"unwatch","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"UNWATCH\"])"}},{"id":"watch(keys:Array(String))-instance-method","html_id":"watch(keys:Array(String))-instance-method","name":"watch","doc":"Marks the given keys to be watched for conditional execution of a transaction.\n\n**Return value**: \"OK\"","summary":"

    Marks the given keys to be watched for conditional execution of a transaction.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1736","def":{"name":"watch","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command(concat([\"WATCH\"], keys))"}},{"id":"watch(*keys)-instance-method","html_id":"watch(*keys)-instance-method","name":"watch","doc":null,"summary":null,"abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1740","def":{"name":"watch","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"watch(keys.to_a)"}},{"id":"zadd(key,*scores_and_members)-instance-method","html_id":"zadd(key,*scores_and_members)-instance-method","name":"zadd","doc":"Adds all the specified members with the specified scores to the sorted set stored at key.\n\n**Return value**: Integer, the number of elements added to the sorted sets, not including elements already existing for which the score was updated.\n\nExample:\n\n```\nredis.zadd(\"myzset\", 1, \"one\")\nredis.zadd(\"myzset\", 2, \"two\", 3, \"three\")\n```","summary":"

    Adds all the specified members with the specified scores to the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":""}],"args_string":"(key, *scores_and_members)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1116","def":{"name":"zadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if (scores_and_members.size % 2) > 0\n raise(Error.new(\"zadd expects an array of scores mapped to members\"))\nend\ninteger_command(concat([\"ZADD\", key.to_s], scores_and_members))\n"}},{"id":"zadd(key,scores_and_members:Array(RedisValue))-instance-method","html_id":"zadd(key,scores_and_members:Array(RedisValue))-instance-method","name":"zadd","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":"Array(RedisValue)"}],"args_string":"(key, scores_and_members : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1124","def":{"name":"zadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if (scores_and_members.size % 2) > 0\n raise(Error.new(\"zadd expects an array of scores mapped to members\"))\nend\ninteger_command(concat([\"ZADD\", key.to_s], scores_and_members))\n"}},{"id":"zcard(key)-instance-method","html_id":"zcard(key)-instance-method","name":"zcard","doc":"Returns the sorted set cardinality (number of elements) of the sorted set stored at key.\n\n**Return value**: Integer, the cardinality (number of elements) of the sorted set, or 0 if key does not exist.","summary":"

    Returns the sorted set cardinality (number of elements) of the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1156","def":{"name":"zcard","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZCARD\", key.to_s])"}},{"id":"zcount(key,min,max)-instance-method","html_id":"zcount(key,min,max)-instance-method","name":"zcount","doc":"Returns the number of elements in the sorted set at key with a score between min and max.\n\n**Return value**: Integer, the number of elements in the specified score range.","summary":"

    Returns the number of elements in the sorted set at key with a score between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1170","def":{"name":"zcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZCOUNT\", key.to_s, min.to_s, max.to_s])"}},{"id":"zincrby(key,increment,member)-instance-method","html_id":"zincrby(key,increment,member)-instance-method","name":"zincrby","doc":"Increments the score of member in the sorted set stored at key by increment.\n\n**Return value**: String, the new score of member (a double precision floating point number represented as String).","summary":"

    Increments the score of member in the sorted set stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, increment, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1184","def":{"name":"zincrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"ZINCRBY\", key.to_s, increment.to_s, member.to_s])"}},{"id":"zinterstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","html_id":"zinterstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","name":"zinterstore","doc":"Computes the intersection of numkeys sorted sets given by the specified keys,\nand stores the result in destination.\n\n**Options**:\n\n* weights - nil or Array(String): Using the WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set.\n* aggregate - With the AGGREGATE option, it is possible to specify how the results of the union are aggregated.\n\n**Return value**: Integer, the number of elements in the resulting sorted set at destination.\n\nExample:\n\n```\nredis.zinterstore(\"zset3\", [\"zset1\", \"zset2\"], weights: [2, 3])\n```","summary":"

    Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"args_string":"(destination, keys : Array, weights = nil, aggregate = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1229","def":{"name":"zinterstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"numkeys = keys.size\nq = concat([\"ZINTERSTORE\", destination.to_s, numkeys.to_s], keys)\nif weights\n q << \"WEIGHTS\"\n concat(q, weights)\nend\nif aggregate\n (q << \"AGGREGATE\") << aggregate.to_s\nend\ninteger_command(q)\n"}},{"id":"zlexcount(key,min,max)-instance-method","html_id":"zlexcount(key,min,max)-instance-method","name":"zlexcount","doc":"When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.\n\n**Return value**: Integer, the number of elements in the specified score range.","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1177","def":{"name":"zlexcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZLEXCOUNT\", key.to_s, min.to_s, max.to_s])"}},{"id":"zrange(key,start,stop,with_scores=false)-instance-method","html_id":"zrange(key,start,stop,with_scores=false)-instance-method","name":"zrange","doc":"Returns the specified range of elements in the sorted set stored at key.\n\n**Options**:\n\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), list of elements in the specified range (optionally with their scores, in case the with_scores option is true).\n\nExample:\n\n```\nredis.zrange(\"myzset\", 0, -1, with_scores: true) # => [\"one\", \"1\", \"uno\", \"1\", \"two\", \"2\", \"three\", \"3\"]\n```","summary":"

    Returns the specified range of elements in the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, start, stop, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1145","def":{"name":"zrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGE\", key.to_s, start.to_s, stop.to_s]\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrangebylex(key,min,max,limit=nil)-instance-method","html_id":"zrangebylex(key,min,max,limit=nil)-instance-method","name":"zrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command returns all the\nelements in the sorted set at key with a value between min and max.\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n\n**Return value**:","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"args_string":"(key, min, max, limit = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1272","def":{"name":"zrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGEBYLEX\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nstring_array_command(q)\n"}},{"id":"zrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","html_id":"zrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","name":"zrangebyscore","doc":"Returns all the elements in the sorted set at key with a score between\nmax and min (including elements with score equal to max or min).\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified score range (optionally with their scores).","summary":"

    Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, min, max, limit = nil, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1289","def":{"name":"zrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGEBYSCORE\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrank(key,member)-instance-method","html_id":"zrank(key,member)-instance-method","name":"zrank","doc":"Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.\n\n**Return value**:\n* If member exists in the sorted set, Integer: the rank of member.\n* If member does not exist in the sorted set or key does not exist: nil.","summary":"

    Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1200","def":{"name":"zrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"ZRANK\", key.to_s, member.to_s])"}},{"id":"zrem(key,member)-instance-method","html_id":"zrem(key,member)-instance-method","name":"zrem","doc":"Removes the specified members from the sorted set stored at key.\n\n**Return value**: Integer, the number of members removed from the sorted set, not including non existing members.","summary":"

    Removes the specified members from the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1191","def":{"name":"zrem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREM\", key.to_s, member.to_s])"}},{"id":"zremrangebylex(key,min,max)-instance-method","html_id":"zremrangebylex(key,min,max)-instance-method","name":"zremrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command removes all\nelements in the sorted set stored at key between the lexicographical range\nspecified by min and max.\n\n**Return value**: Integer, the number of elements removed.","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1359","def":{"name":"zremrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYLEX\", key.to_s, min.to_s, max.to_s])"}},{"id":"zremrangebyrank(key,start,stop)-instance-method","html_id":"zremrangebyrank(key,start,stop)-instance-method","name":"zremrangebyrank","doc":"Removes all elements in the sorted set stored at key with rank between start and stop.\n\n**Return value**: Integer, the number of elements removed.","summary":"

    Removes all elements in the sorted set stored at key with rank between start and stop.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1366","def":{"name":"zremrangebyrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYRANK\", key.to_s, start.to_s, stop.to_s])"}},{"id":"zremrangebyscore(key,start,stop)-instance-method","html_id":"zremrangebyscore(key,start,stop)-instance-method","name":"zremrangebyscore","doc":"Removes all elements in the sorted set stored at key with a score\nbetween min and max (inclusive).\n\n**Return value**: Integer, the number of elements removed.","summary":"

    Removes all elements in the sorted set stored at key with a score between min and max (inclusive).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1374","def":{"name":"zremrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYSCORE\", key.to_s, start.to_s, stop.to_s])"}},{"id":"zrevrange(key,start,stop,with_scores=false)-instance-method","html_id":"zrevrange(key,start,stop,with_scores=false)-instance-method","name":"zrevrange","doc":"Returns the specified range of elements in the sorted set stored at key.\n\n**Options**:\n\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified range (optionally with their scores, in case the with_scores option is true).","summary":"

    Returns the specified range of elements in the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, start, stop, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1307","def":{"name":"zrevrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGE\", key.to_s, start.to_s, stop.to_s]\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrevrangebylex(key,min,max,limit=nil)-instance-method","html_id":"zrevrangebylex(key,min,max,limit=nil)-instance-method","name":"zrevrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command returns all the\nelements in the sorted set at key with a value between min and max.\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n\n**Return value**:","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"args_string":"(key, min, max, limit = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1325","def":{"name":"zrevrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGEBYLEX\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nstring_array_command(q)\n"}},{"id":"zrevrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","html_id":"zrevrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","name":"zrevrangebyscore","doc":"Returns all the elements in the sorted set at key with a score between\nmax and min (including elements with score equal to max or min).\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified score range (optionally with their scores).","summary":"

    Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, min, max, limit = nil, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1342","def":{"name":"zrevrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGEBYSCORE\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrevrank(key,member)-instance-method","html_id":"zrevrank(key,member)-instance-method","name":"zrevrank","doc":"Returns the rank of member in the sorted set stored at key,\nwith the scores ordered from high to low.\n\n**Return value**:\n* If member exists in the sorted set, Integer: the rank of member.\n* If member does not exist in the sorted set or key does not exist: nil.","summary":"

    Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1210","def":{"name":"zrevrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"ZREVRANK\", key.to_s, member.to_s])"}},{"id":"zscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"zscan(key,cursor,match=nil,count=nil)-instance-method","name":"zscan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array(String), contains two elements, a member and its associated score, for every returned element of the sorted set.\n\nExample:\n\n```\nredis.zscan(\"myzset\", 0)\nredis.zscan(\"myzset\", 0, \"foo*\")\nredis.zscan(\"myzset\", 0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1394","def":{"name":"zscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"zscore(key,member)-instance-method","html_id":"zscore(key,member)-instance-method","name":"zscore","doc":"Returns the score of member in the sorted set at key.\n\n**Return value**: String, the score of member (a double precision floating point number).","summary":"

    Returns the score of member in the sorted set at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1163","def":{"name":"zscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"ZSCORE\", key.to_s, member.to_s])"}},{"id":"zunionstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","html_id":"zunionstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","name":"zunionstore","doc":"Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.\n\n**Options**:\n\n* weights - nil or Array(String): Using the WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set.\n* aggregate - With the AGGREGATE option, it is possible to specify how the results of the union are aggregated.\n\n**Return value**: Integer, the number of elements in the resulting sorted set at destination.","summary":"

    Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"args_string":"(destination, keys : Array, weights = nil, aggregate = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1250","def":{"name":"zunionstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"numkeys = keys.size\nq = concat([\"ZUNIONSTORE\", destination.to_s, numkeys.to_s], keys)\nif weights\n q << \"WEIGHTS\"\n concat(q, weights)\nend\nif aggregate\n (q << \"AGGREGATE\") << aggregate.to_s\nend\ninteger_command(q)\n"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandTimeoutError","path":"Redis/CommandTimeoutError.html","kind":"class","full_name":"Redis::CommandTimeoutError","name":"CommandTimeoutError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":18,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when the `command_timeout` option triggers - a command took too long because the Redis-server is blocked by another command or by a dump.","summary":"

    Raised when the command_timeout option triggers - a command took too long because the Redis-server is blocked by another command or by a dump.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","path":"Redis/ConnectionError.html","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":6,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CannotConnectError","kind":"class","full_name":"Redis::CannotConnectError","name":"CannotConnectError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionLostError","kind":"class","full_name":"Redis::ConnectionLostError","name":"ConnectionLostError"}],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"An error that makes the connection unusable.","summary":"

    An error that makes the connection unusable.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionLostError","path":"Redis/ConnectionLostError.html","kind":"class","full_name":"Redis::ConnectionLostError","name":"ConnectionLostError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":14,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when the connection to the Redis server is lost.","summary":"

    Raised when the connection to the Redis server is lost.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","path":"Redis/Error.html","kind":"class","full_name":"Redis::Error","name":"Error","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":2,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandTimeoutError","kind":"class","full_name":"Redis::CommandTimeoutError","name":"CommandTimeoutError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PoolTimeoutError","kind":"class","full_name":"Redis::PoolTimeoutError","name":"PoolTimeoutError"}],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Exception for errors raised by this shard.","summary":"

    Exception for errors raised by this shard.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Future","path":"Redis/Future.html","kind":"class","full_name":"Redis::Future","name":"Future","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/future.cr","line_number":6,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/future.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Futures are handles for values that will become available at a later point in time.\n\nThe API methods Redis#pipelined and Redis#multi make commands return futures instead of actual values.\n\nSee this [example](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/pipelining.cr).","summary":"

    Futures are handles for values that will become available at a later point in time.

    ","class_methods":[],"constructors":[{"id":"new-class-method","html_id":"new-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/future.cr#L9","def":{"name":"new","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"value-instance-method","html_id":"value-instance-method","name":"value","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/future.cr#L14","def":{"name":"value","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if @ready\n @value\nelse\n raise(Redis::Error.new(\"Future value not ready yet\"))\nend"}},{"id":"value=(new_value)-instance-method","html_id":"value=(new_value)-instance-method","name":"value=","doc":null,"summary":null,"abstract":false,"args":[{"name":"new_value","doc":null,"default_value":"","external_name":"new_value","restriction":""}],"args_string":"(new_value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/future.cr#L22","def":{"name":"value=","args":[{"name":"new_value","doc":null,"default_value":"","external_name":"new_value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@value = new_value\n@ready = true\n"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PipelineApi","path":"Redis/PipelineApi.html","kind":"class","full_name":"Redis::PipelineApi","name":"PipelineApi","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/pipeline_api.cr","line_number":18,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pipeline_api.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"API for sending commands in pipelined mode.\n\nUsed in Redis#pipelined.\n\nExample:\n\n```\nredis.pipelined do |pipeline|\n pipeline.set(\"foo1\", \"first\")\n pipeline.set(\"foo2\", \"second\")\nend\n```\n\nIn this example, the `pipeline` object passed to the block is a PipelineApi\nobject.","summary":"

    API for sending commands in pipelined mode.

    ","class_methods":[],"constructors":[{"id":"new(strategy)-class-method","html_id":"new(strategy)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"args_string":"(strategy)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pipeline_api.cr#L21","def":{"name":"new","args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(strategy)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PooledClient","path":"Redis/PooledClient.html","kind":"class","full_name":"Redis::PooledClient","name":"PooledClient","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/pooled_client.cr","line_number":20,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"A Redis client object that can be shared across multiple fibers.\nIt is backed by a connection pool of `Redis` instances and will automatically allocate and free these instances from/to the pool, per command.\n\nExample usage:\n\n```Crystal\nredis = Redis::PooledClient.new(host: ..., port: ..., ..., pool_size: 5)\n10.times do |i|\n spawn do\n redis.set(\"foo#{i}\", \"bar\")\n redis.get(\"foo#{i}\") # => \"bar\"\n end\nend\n```\n\nHere 10 fibers access the same `Redis::PooledClient` instance while automatically sharing 5 Redis connections.\n","summary":"

    A Redis client object that can be shared across multiple fibers.

    ","class_methods":[],"constructors":[{"id":"new(*args,pool_size=5,pool_timeout=5.0,**args2)-class-method","html_id":"new(*args,pool_size=5,pool_timeout=5.0,**args2)-class-method","name":"new","doc":"Accepts the same connection parameters like a `Redis` instance, plus the documented ones.\n\n* pool_size - the number of `Redis` to hold in the connection pool.\n* pool_timeout - the time to wait for a `Redis` instance to become available from the pool before dying with `Redis::PoolTimeoutError`.","summary":"

    Accepts the same connection parameters like a Redis instance, plus the documented ones.

    ","abstract":false,"args":[{"name":"args","doc":null,"default_value":"","external_name":"args","restriction":""},{"name":"pool_size","doc":null,"default_value":"5","external_name":"pool_size","restriction":""},{"name":"pool_timeout","doc":null,"default_value":"5.0","external_name":"pool_timeout","restriction":""}],"args_string":"(*args, pool_size = 5, pool_timeout = 5.0, **args2)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr#L29","def":{"name":"new","args":[{"name":"args","doc":null,"default_value":"","external_name":"args","restriction":""},{"name":"pool_size","doc":null,"default_value":"5","external_name":"pool_size","restriction":""},{"name":"pool_timeout","doc":null,"default_value":"5.0","external_name":"pool_timeout","restriction":""}],"double_splat":{"name":"args2","doc":null,"default_value":"","external_name":"args2","restriction":""},"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(*args, **args2, pool_size: pool_size, pool_timeout: pool_timeout)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"pool:ConnectionPool(Redis)-instance-method","html_id":"pool:ConnectionPool(Redis)-instance-method","name":"pool","doc":"The connection pool.\nSee [https://github.com/ysbaddaden/pool](https://github.com/ysbaddaden/pool)","summary":"

    The connection pool.

    ","abstract":false,"args":[],"args_string":" : ConnectionPool(Redis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr#L23","def":{"name":"pool","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@pool"}},{"id":"psubscribe(*channel_patterns,&callback_setup_block:Redis::Subscription->)-instance-method","html_id":"psubscribe(*channel_patterns,&callback_setup_block:Redis::Subscription->)-instance-method","name":"psubscribe","doc":null,"summary":null,"abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns, &callback_setup_block : Redis::Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr#L59","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Redis::Subscription -> )"},"return_type":"","visibility":"Public","body":"with_pool_connection(&.psubscribe(*channel_patterns) do |s|\n callback_setup_block.call(s)\nend)"}},{"id":"subscribe(*channels,&callback_setup_block:Redis::Subscription->)-instance-method","html_id":"subscribe(*channels,&callback_setup_block:Redis::Subscription->)-instance-method","name":"subscribe","doc":null,"summary":null,"abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels, &callback_setup_block : Redis::Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr#L55","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Redis::Subscription -> )"},"return_type":"","visibility":"Public","body":"with_pool_connection(&.subscribe(*channels) do |s|\n callback_setup_block.call(s)\nend)"}}],"macros":[{"id":"method_missing(call)-macro","html_id":"method_missing(call)-macro","name":"method_missing","doc":null,"summary":null,"abstract":false,"args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"args_string":"(call)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr#L35","def":{"name":"method_missing","args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"double_splat":null,"splat_index":null,"block_arg":null,"visibility":"Public","body":" \n# Delegates all Redis commands to a `Redis` instance from the connection pool.\n\n with_pool_connection \n{ |conn| conn.\n{{ call }}\n }\n \n"}}],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PoolTimeoutError","path":"Redis/PoolTimeoutError.html","kind":"class","full_name":"Redis::PoolTimeoutError","name":"PoolTimeoutError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":22,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when no free connection became available in the pool within a certain time.","summary":"

    Raised when no free connection became available in the pool within a certain time.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/SocketWrapper","path":"Redis/SocketWrapper.html","kind":"struct","full_name":"Redis::SocketWrapper","name":"SocketWrapper","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"github.com/stefanwille/crystal-redis/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/socket_wrapper.cr","line_number":4,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/socket_wrapper.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Wraps an open socket connection.\n\nThe purpose is to be able to convert all exceptions to Redis:Error's.","summary":"

    Wraps an open socket connection.

    ","class_methods":[],"constructors":[{"id":"new(socket:TCPSocket|UNIXSocket|OpenSSL::SSL::Socket::Client)-class-method","html_id":"new(socket:TCPSocket|UNIXSocket|OpenSSL::SSL::Socket::Client)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"socket","doc":null,"default_value":"","external_name":"socket","restriction":"TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client"}],"args_string":"(socket : TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/socket_wrapper.cr#L5","def":{"name":"new","args":[{"name":"socket","doc":null,"default_value":"","external_name":"socket","restriction":"TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(socket)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"id":"new(&block)-class-method","html_id":"new(&block)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/socket_wrapper.cr#L9","def":{"name":"new","args":[],"double_splat":null,"splat_index":null,"yields":0,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n self.new(yield)\nrescue ex : IO::Timeout | Errno | Socket::Error | OpenSSL::Error\n raise(Redis::CannotConnectError.new(\"#{ex.class}: #{ex.message}\"))\nend"}}],"instance_methods":[{"id":"close-instance-method","html_id":"close-instance-method","name":"close","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/socket_wrapper.cr#L27","def":{"name":"close","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n if @connected\n @connected = false\n @socket.close\n end\nrescue Errno\nend"}}],"macros":[{"id":"method_missing(call)-macro","html_id":"method_missing(call)-macro","name":"method_missing","doc":null,"summary":null,"abstract":false,"args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"args_string":"(call)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/socket_wrapper.cr#L15","def":{"name":"method_missing","args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"double_splat":null,"splat_index":null,"block_arg":null,"visibility":"Public","body":" catch_errors \n{ @socket.\n{{ call }}\n }\n \n"}}],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Subscription","path":"Redis/Subscription.html","kind":"class","full_name":"Redis::Subscription","name":"Subscription","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/subscription.cr","line_number":5,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Models a subscription to one or more publish/subscribe channels.\n\nThe caller sets callbacks on this object that the Redis client will\ntrigger for the matching events.","summary":"

    Models a subscription to one or more publish/subscribe channels.

    ","class_methods":[],"constructors":[],"instance_methods":[{"id":"message(&message_callback:String,String->)-instance-method","html_id":"message(&message_callback:String,String->)-instance-method","name":"message","doc":"Sets the 'message' callback.","summary":"

    Sets the 'message' callback.

    ","abstract":false,"args":[],"args_string":"(&message_callback : String, String -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L28","def":{"name":"message","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"message_callback","doc":null,"default_value":"","external_name":"message_callback","restriction":"(String, String -> )"},"return_type":"","visibility":"Public","body":"@message_callback = message_callback"}},{"id":"pmessage(&pmessage_callback:String,String,String->)-instance-method","html_id":"pmessage(&pmessage_callback:String,String,String->)-instance-method","name":"pmessage","doc":"Sets the 'pmessage' callback.","summary":"

    Sets the 'pmessage' callback.

    ","abstract":false,"args":[],"args_string":"(&pmessage_callback : String, String, String -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L32","def":{"name":"pmessage","args":[],"double_splat":null,"splat_index":null,"yields":3,"block_arg":{"name":"pmessage_callback","doc":null,"default_value":"","external_name":"pmessage_callback","restriction":"(String, String, String -> )"},"return_type":"","visibility":"Public","body":"@pmessage_callback = pmessage_callback"}},{"id":"psubscribe(&psubscribe_callback:String,Int64->)-instance-method","html_id":"psubscribe(&psubscribe_callback:String,Int64->)-instance-method","name":"psubscribe","doc":"Sets the 'psubscribe' callback.","summary":"

    Sets the 'psubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&psubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L24","def":{"name":"psubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"psubscribe_callback","doc":null,"default_value":"","external_name":"psubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@psubscribe_callback = psubscribe_callback"}},{"id":"punsubscribe(&punsubscribe_callback:String,Int64->)-instance-method","html_id":"punsubscribe(&punsubscribe_callback:String,Int64->)-instance-method","name":"punsubscribe","doc":"Sets the 'punsubscribe' callback.","summary":"

    Sets the 'punsubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&punsubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L40","def":{"name":"punsubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"punsubscribe_callback","doc":null,"default_value":"","external_name":"punsubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@punsubscribe_callback = punsubscribe_callback"}},{"id":"subscribe(&subscribe_callback:String,Int64->)-instance-method","html_id":"subscribe(&subscribe_callback:String,Int64->)-instance-method","name":"subscribe","doc":"Sets the 'subscribe' callback.","summary":"

    Sets the 'subscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&subscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L20","def":{"name":"subscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"subscribe_callback","doc":null,"default_value":"","external_name":"subscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@subscribe_callback = subscribe_callback"}},{"id":"unsubscribe(&unsubscribe_callback:String,Int64->)-instance-method","html_id":"unsubscribe(&unsubscribe_callback:String,Int64->)-instance-method","name":"unsubscribe","doc":"Sets the 'unsubscribe' callback.","summary":"

    Sets the 'unsubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&unsubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L36","def":{"name":"unsubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"unsubscribe_callback","doc":null,"default_value":"","external_name":"unsubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@unsubscribe_callback = unsubscribe_callback"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/TransactionApi","path":"Redis/TransactionApi.html","kind":"class","full_name":"Redis::TransactionApi","name":"TransactionApi","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/transaction_api.cr","line_number":19,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/transaction_api.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"API for sending commands in a transaction.\n\nUsed in Redis#multi.\n\n\nExample:\n\n```\nredis.multi do |multi|\n multi.set(\"foo1\", \"first\")\n multi.set(\"foo2\", \"second\")\nend\n```\n\nIn this example, the `multi` object passed to the block is a TransactionApi\nobject.","summary":"

    API for sending commands in a transaction.

    ","class_methods":[],"constructors":[{"id":"new(strategy)-class-method","html_id":"new(strategy)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"args_string":"(strategy)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/transaction_api.cr#L22","def":{"name":"new","args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(strategy)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"discard-instance-method","html_id":"discard-instance-method","name":"discard","doc":"Aborts the current transaction.\n\n**Example**:\n\n```\nredis.multi do |multi|\n multi.set(\"foo\", \"the new value\")\n multi.discard\nend\n```","summary":"

    Aborts the current transaction.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/transaction_api.cr#L39","def":{"name":"discard","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@strategy.discard"}}],"macros":[],"types":[]}]}]}} \ No newline at end of file diff --git a/docs/search-index.js b/docs/search-index.js index 82b6828..a881194 100644 --- a/docs/search-index.js +++ b/docs/search-index.js @@ -1 +1 @@ -crystal_doc_search_index_callback({"repository_name":"github.com/stefanwille/crystal-redis","body":"# Redis Client for Crystal\n\n[![Build Status](https://img.shields.io/travis/stefanwille/crystal-redis/master.svg?style=flat)](https://travis-ci.org/stefanwille/crystal-redis) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests)\n\nA Redis client for the Crystal programming language.\n\n## Features\n\n- Performance (> 680,000 commands per second using pipeline on a MacBook Air with a single client thread)\n- Pipelining\n- Transactions\n- LUA Scripting\n- All string commands\n- All hash commands\n- All list commands\n- All set commands\n- All hyperloglog commands\n- All commands for bit operations\n- All sorted set commands\n- Publish/subscribe\n\n## Installation\n\nAdd it to your `shard.yml`:\n\n```crystal\ndependencies:\n redis:\n github: stefanwille/crystal-redis\n version: ~> 2.2.1\n```\n\nand then install the library into your project:\n\n```bash\n$ shards install\n```\n\n### Installation on MacOS X\n\nOn MacOS X you may get this error:\n\n```\nld: library not found for -lssl (this usually means you need to install the development package for libssl)\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\n...\n```\n\nOr this warning:\n\n```\nPackage libssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libssl.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'libssl' found\nPackage libcrypto was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libcrypto.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'libcrypto' found\n```\n\nThe problem is that Crystal can't find openssl, because it is not installed by default on MacOS X.\n\nThe fix:\n\n1. Install openssl via [Homebrew](https://brew.sh/):\n\n```bash\n$ brew install openssl\n```\n\n2. Set the environment variable `PKG_CONFIG_PATH`:\n\n```bash\n$ export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig\n```\n\nNote: Please write me if you know a better way!\n\n## Required Crystal Version\n\nThis library needs Crystal version >= 0.25.0\n\nI haven't tested older Crystal versions.\n\n## Usage\n\nRequire the package:\n\n```crystal\n require \"redis\"\n```\n\nthen\n\n```crystal\n redis = Redis.new\n```\n\nThen you can call Redis commands on the `redis` object:\n\n```crystal\n redis.set(\"foo\", \"bar\")\n redis.get(\"foo\")\n```\n\n#### Connection Pooling\n\nSince version 2.0.0, a connection pool is built in. It is used implicitly through `Redis::PooledClient`:\n\n```Crystal\nredis = Redis::PooledClient.new\n10.times do |i|\n spawn do\n redis.set(\"foo#{i}\", \"bar\")\n redis.get(\"foo#{i}\") # => \"bar\"\n end\nend\n```\n\nThis `redis` instance can be shared across fibers, and accepts the same Redis commands as the `Redis` class.\nIt automatically allocates and frees connections from/to the pool, per command.\n\n## Examples\n\nTo get started, see the examples:\n\n- There is a separate git repository [crystal-redis-examples](https://github.com/stefanwille/crystal-redis-examples) with examples.\n- start with this [basic example](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/basic.cr)\n- look at [the other examples](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/)\n- the [spec](https://github.com/stefanwille/crystal-redis/blob/master/spec/redis_spec.cr) contains even more usage examples\n\n## Documentation\n\n- [API documentation](http://stefanwille.github.io/crystal-redis) -\n start reading it at the class `Redis`.\n- [Redis commands documentation](http://redis.io/commands) - the original Redis documentation is necessary, as the API documentation above is just a quick reference\n- [Redis documentation page](http://redis.io/documentation) - general information about Redis and its concepts\n\n## Performance\n\nI have benchmarked Crystal-Redis against several other client libraries in various programming languages in this [blog article](http://www.stefanwille.com/2015/05/redis-clients-crystal-vs-ruby-vs-c-vs-go/).\n\nHere are some results:\n\n- Crystal: With this library I get > 680,000 commands per second using pipeline on a MacBook Air with a single client thread.\n\n- C: The equivalent program written in C with Hiredis gets me 340,000 commands per second.\n\n- Ruby: Ruby 2.2.1 with the [redis-rb](https://github.com/redis/redis-rb) and Hiredis driver handles 150,000 commands per second.\n\n[Read more results](http://www.stefanwille.com/2015/05/redis-clients-crystal-vs-ruby-vs-c-vs-go/) for Go, Java, Node.js.\n\n## Status\n\nI have exercised every API method in the spec and built some example programs. Some people report production usage.\n\nI took great care to make this library very usable with respect to API, reliability and documentation.\n\n## Development\n\nThis project requires a locally running redis server running on port 6379 and with a Unix socket located at /tmp/redis.sock. In Homebrew's default redis.config the Unix domain socket option is disabled. To enable, edit `/usr/local/etc/redis.conf` or whatever your `redis.conf` is and uncomment this line:\n\n```\n# unixsocket /tmp/redis.sock\n```\n\nso that it reads\n\n```\nunixsocket /tmp/redis.sock\n```\n\nThen you can run the specs via\n\n`$ crystal spec`\n\n[See more information](https://github.com/stefanwille/crystal-redis/blob/master/CONTRIBUTING.md).\n\n### WARNING\n\nRunning the spec will delete database number 0!\n\n## Questions, Bugs & Support\n\nIf you have questions or need help, please open a ticket in the [GitHub issue tracker](https://github.com/stefanwille/crystal-redis/issues). This way others can benefit from the discussion.\n","program":{"html_id":"github.com/stefanwille/crystal-redis/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"superclass":null,"ancestors":[],"locations":[],"repository_name":"github.com/stefanwille/crystal-redis","program":true,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":null,"doc":null,"summary":null,"class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis","path":"Redis.html","kind":"class","full_name":"Redis","name":"Redis","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/ValueOriented","kind":"module","full_name":"Redis::CommandExecution::ValueOriented","name":"ValueOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/commands.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr"},{"filename":"redis/command_execution/value_oriented.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/command_execution/value_oriented.cr"},{"filename":"redis.cr","line_number":37,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr"},{"filename":"redis/command_execution/future_oriented.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/command_execution/future_oriented.cr"},{"filename":"redis/strategy/base.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/strategy/base.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/ValueOriented","kind":"module","full_name":"Redis::CommandExecution::ValueOriented","name":"ValueOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":null,"doc":"The class is the main entry point for the Redis client.\n\n**How to use**:\n\nRequire the package:\n\n```crystal\nrequire \"redis\"\n```\n\nThen instantiate this client class:\n\n```crystal\nredis = Redis.new\n```\n\nThen you can call Redis commands on the `redis` object:\n\n```crystal\nredis.set(\"foo\", \"bar\")\nredis.get(\"foo\")\nredis.incr(\"visitors\")\n```\n\nSee the mixin module [Commands](Redis/Commands.html) for most\nof the available Redis commands such as #incr, #rename, and so on.\n\n**Multithreading / Coroutines**\n\nPlease mind that a Redis object can't be shared across multiple threads/coroutines!\nEach thread/coroutine that wants to talk to Redis needs its own Redis object instance.","summary":"

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

    ","class_methods":[{"id":"open(host="localhost",port=6379,unixsocket=nil,password=nil,database=nil,url=nil,ssl=false,ssl_context=nil,dns_timeout=nil,connect_timeout=nil,reconnect=true,command_timeout=nil,&block)-class-method","html_id":"open(host=&quot;localhost&quot;,port=6379,unixsocket=nil,password=nil,database=nil,url=nil,ssl=false,ssl_context=nil,dns_timeout=nil,connect_timeout=nil,reconnect=true,command_timeout=nil,&block)-class-method","name":"open","doc":"Opens a Redis connection, yields the given block with a Redis object and closes the connection.\n\n**Options**:\n* host - the host to connect to\n* port - the port to connect to\n* unixsocket - instead of using TCP, you can connect to Redis via a Unix domain socket by passing its path here (e.g. \"/tmp/redis.sock\")\n* password - the password for authentication against the server. This is a convenience which saves you the extra call to the Redis `auth` command.\n* database - the number of the database to select. This a convenience which saves you a call a call to `#select`.\n* ssl - whether SSL should be enabled.\n* ssl_context - a OpenSSL::SSL::Context::Client.\n* dns_timeout - the dns timeout.\n* connect_timeout - the connect timeout.\n* command_timeout - the command timeout - applies when a command takes too long because the Redis-server is blocked by another command or by a dump.\n* reconnect - whether we should reconnect when we encounter a disconnected Redis connection.\n* url - Redis url. If this is given, it overrides all others.\n\nExample:\n\n```\nRedis.open do |redis|\n redis.incr(\"counter\")\nend\n```","summary":"

    Opens a Redis connection, yields the given block with a Redis object and closes the connection.

    ","abstract":false,"args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":""},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":""},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":""},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":""},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":""},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":""},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":""}],"args_string":"(host = "localhost", port = 6379, unixsocket = nil, password = nil, database = nil, url = nil, ssl = false, ssl_context = nil, dns_timeout = nil, connect_timeout = nil, reconnect = true, command_timeout = nil, &block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L193","def":{"name":"open","args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":""},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":""},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":""},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":""},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":""},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":""},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":""}],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"redis = Redis.new(host, port, unixsocket, password, database, url, ssl, ssl_context, dns_timeout, connect_timeout, reconnect, command_timeout)\nbegin\n yield redis\nensure\n redis.close\nend\n"}}],"constructors":[{"id":"new(host="localhost",port=6379,unixsocket:String?=nil,password:String?=nil,database:Int32?=nil,url=nil,ssl=false,ssl_context:OpenSSL::SSL::Context::Client?=nil,dns_timeout:Time::Span?=nil,connect_timeout:Time::Span?=nil,reconnect=true,command_timeout:Time::Span?=nil)-class-method","html_id":"new(host=&quot;localhost&quot;,port=6379,unixsocket:String?=nil,password:String?=nil,database:Int32?=nil,url=nil,ssl=false,ssl_context:OpenSSL::SSL::Context::Client?=nil,dns_timeout:Time::Span?=nil,connect_timeout:Time::Span?=nil,reconnect=true,command_timeout:Time::Span?=nil)-class-method","name":"new","doc":"Opens a Redis connection\n\n**Options**:\n* host - the host to connect to\n* port - the port to connect to\n* unixsocket - instead of using TCP, you can connect to Redis via a Unix domain socket by passing its path here (e.g. \"/tmp/redis.sock\")\n* password - the password for authentication against the server. This is a convenience which saves you the extra call to the Redis `auth` command.\n* database - the number of the database to select. This a convenience which saves you a call a call to `#select`.\n* ssl - whether SSL should be enabled.\n* ssl_context - a OpenSSL::SSL::Context::Client.\n* dns_timeout - the dns timeout.\n* connect_timeout - the connect timeout.\n* command_timeout - the command timeout - applies when a command takes too long because the Redis-server is blocked by another command or by a dump.\n* reconnect - whether we should reconnect when we encounter a disconnected Redis connection.\n* url - Redis url. If this is given, it overrides all others.\n\nExample:\n\n```\nredis = Redis.new\nredis.incr(\"counter\")\nredis.close\n```\n\nExample:\n\n```\nredis = Redis.new(host: \"localhost\", port: 6379)\n...\n```\n\nExample:\n\n```\nredis = Redis.new(unixsocket: \"/tmp/redis.sock\")\n...\n```\n\nExample:\n\n```\nredis = Redis.new(url: \"redis://:my-secret-pw@my.redis.com:6380/my-database\")\n...\n```","summary":"

    Opens a Redis connection

    ","abstract":false,"args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":"String | ::Nil"},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":"Int32 | ::Nil"},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":"OpenSSL::SSL::Context::Client | ::Nil"},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":"Time::Span | ::Nil"},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":"Time::Span | ::Nil"},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":"Time::Span | ::Nil"}],"args_string":"(host = "localhost", port = 6379, unixsocket : String? = nil, password : String? = nil, database : Int32? = nil, url = nil, ssl = false, ssl_context : OpenSSL::SSL::Context::Client? = nil, dns_timeout : Time::Span? = nil, connect_timeout : Time::Span? = nil, reconnect = true, command_timeout : Time::Span? = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L95","def":{"name":"new","args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":"String | ::Nil"},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":"Int32 | ::Nil"},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":"OpenSSL::SSL::Context::Client | ::Nil"},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":"Time::Span | ::Nil"},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":"Time::Span | ::Nil"},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":"Time::Span | ::Nil"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(host, port, unixsocket, password, database, url, ssl, ssl_context, dns_timeout, connect_timeout, reconnect, command_timeout)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"close-instance-method","html_id":"close-instance-method","name":"close","doc":"Closes the Redis connection.","summary":"

    Closes the Redis connection.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L205","def":{"name":"close","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@connection.try(&.close)\n@connection = nil\n@strategy = nil\n"}},{"id":"multi(&block)-instance-method","html_id":"multi(&block)-instance-method","name":"multi","doc":"Sends Redis commands in transaction mode.\n\nYields its block. The block receives as argument\nan object that has the same API as this class, except:\n * it participates in the transaction\n * all the Redis commands return Futures\n * there is an additional method #discard that will abort the transaction.\n\n**Return value**: an array with all the responses\n- one element for each executed command.\n\nExample:\n\n```\nredis.multi do |multi|\n multi.set(\"foo1\", \"first\")\n multi.set(\"foo2\", \"second\")\nend\n```\n\nSee the [examples repository](https://github.com/stefanwille/crystal-redis-examples) for more examples.","summary":"

    Sends Redis commands in transaction mode.

    ","abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L284","def":{"name":"multi","args":[],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n @strategy = Redis::Strategy::PauseDuringTransaction.new\n transaction_strategy = Redis::Strategy::Transaction.new(connection)\n transaction_strategy.begin\n transaction_api = Redis::TransactionApi.new(transaction_strategy)\n yield transaction_api\n transaction_strategy.commit.as(Array(RedisValue))\nrescue ex : Redis::ConnectionError | Redis::CommandTimeoutError\n close\n raise(ex)\nensure\n if @connection\n @strategy = Redis::Strategy::SingleStatement.new(@connection.not_nil!)\n end\nend"}},{"id":"pipelined(&block)-instance-method","html_id":"pipelined(&block)-instance-method","name":"pipelined","doc":"Sends Redis commands in pipeline mode.\n\nYields its block. The block receives as argument\nan object that has the same API as this class, except\nit participates in pipelining and all Redis commands return Futures.\n\n**Return value**: an array with all the responses\n- one element for each executed command.\n\nExample:\n\n```\nredis.pipelined do |pipeline|\n pipeline.set(\"foo1\", \"first\")\n pipeline.set(\"foo2\", \"second\")\nend\n```\n\nSee the [examples repository](https://github.com/stefanwille/crystal-redis-examples) for more examples.","summary":"

    Sends Redis commands in pipeline mode.

    ","abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L248","def":{"name":"pipelined","args":[],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n @strategy = Redis::Strategy::PauseDuringPipeline.new\n pipeline_strategy = Redis::Strategy::Pipeline.new(connection)\n pipeline_api = Redis::PipelineApi.new(pipeline_strategy)\n yield pipeline_api\n pipeline_strategy.commit.as(Array(RedisValue))\nrescue ex : Redis::ConnectionError | Redis::CommandTimeoutError\n close\n raise(ex)\nensure\n if @connection\n @strategy = Redis::Strategy::SingleStatement.new(@connection.not_nil!)\n end\nend"}},{"id":"url-instance-method","html_id":"url-instance-method","name":"url","doc":"Returns the server URL for this client.","summary":"

    Returns the server URL for this client.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis.cr#L212","def":{"name":"url","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"scheme = @ssl ? \"rediss\" : \"redis\"\nif @unixsocket\n \"#{scheme}://#{@unixsocket}/#{@database || 0}\"\nelse\n \"#{scheme}://#{@host}:#{@port}/#{@database || 0}\"\nend\n"}}],"macros":[],"types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CannotConnectError","path":"Redis/CannotConnectError.html","kind":"class","full_name":"Redis::CannotConnectError","name":"CannotConnectError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":10,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when connecting to the Redis server is not possible.","summary":"

    Raised when connecting to the Redis server is not possible.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","path":"Redis/Commands.html","kind":"module","full_name":"Redis::Commands","name":"Commands","abstract":false,"superclass":null,"ancestors":[],"locations":[{"filename":"redis/commands.cr","line_number":4,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PipelineApi","kind":"class","full_name":"Redis::PipelineApi","name":"PipelineApi"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/TransactionApi","kind":"class","full_name":"Redis::TransactionApi","name":"TransactionApi"}],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Definition of all Redis commands except pipelining and transactions.\n","summary":"

    Definition of all Redis commands except pipelining and transactions.

    ","class_methods":[],"constructors":[],"instance_methods":[{"id":"append(key,value)-instance-method","html_id":"append(key,value)-instance-method","name":"append","doc":"If key already exists and is a string, this command appends the value at the end of the string.\nIf key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.\n\n**Return value**: Integer, the length of the string after the append operation.\n\nExample:\n\n```\nredis.append(\"foo\", \" world\")\n```","summary":"

    If key already exists and is a string, this command appends the value at the end of the string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L366","def":{"name":"append","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"APPEND\", key.to_s, value.to_s])"}},{"id":"auth(password)-instance-method","html_id":"auth(password)-instance-method","name":"auth","doc":"Request for authentication in a password-protected Redis server.\n\n**Return value**: \"OK\"","summary":"

    Request for authentication in a password-protected Redis server.

    ","abstract":false,"args":[{"name":"password","doc":null,"default_value":"","external_name":"password","restriction":""}],"args_string":"(password)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L87","def":{"name":"auth","args":[{"name":"password","doc":null,"default_value":"","external_name":"password","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"AUTH\", password])"}},{"id":"bitcount(key,from=nil,to=nil)-instance-method","html_id":"bitcount(key,from=nil,to=nil)-instance-method","name":"bitcount","doc":"Count the number of set bits (population counting) in a string.\nBy default all the bytes contained in the string are examined.\n\n**Options**:\n\n* from / to - It is possible to specify the counting operation only in an interval passing the additional arguments from and to.\n\n**Return value** Integer, the number of bits set to 1.\n\nExample:\n\n```\nredis.bitcount(\"foo\", 0, 0)\n```","summary":"

    Count the number of set bits (population counting) in a string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"nil","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"args_string":"(key, from = nil, to = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L418","def":{"name":"bitcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"nil","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BITCOUNT\", key.to_s]\nif from\n if to\n q << from.to_s\n q << to.to_s\n else\n raise(Redis::Error.new(\"from specified, but not to\"))\n end\nend\ninteger_command(q)\n"}},{"id":"bitop(operation,key,*keys)-instance-method","html_id":"bitop(operation,key,*keys)-instance-method","name":"bitop","doc":"Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.\n\n**Return value**: Integer, the size of the string stored in the destination key, that is equal to the size of the longest input string.\n\nExample:\n\n```\nredis.bitop(\"and\", \"dest\", \"key1\", \"key2\")\n```","summary":"

    Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

    ","abstract":false,"args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(operation, key, *keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L440","def":{"name":"bitop","args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":2,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"BITOP\", operation.to_s, key.to_s], keys))"}},{"id":"bitpos(key,bit,start=nil,to=nil)-instance-method","html_id":"bitpos(key,bit,start=nil,to=nil)-instance-method","name":"bitpos","doc":"Return the position of the first bit set to 1 or 0 in a string.\n\n**Options**:\n\n* start / to - By default, all the bytes contained in the string are examined. It is possible to look for bits only in a specified interval passing the additional arguments start and to (it is possible to just pass start, the operation will assume that the to is the last byte of the string.\n\n**Return value**: Integer, the command returns the position of the first bit set to 1 or 0 according to the request.\n\nExample:\n\n```\nredis.set(\"mykey\", \"0\")\nredis.bitpos(\"mykey\", 1) # => 2\n```","summary":"

    Return the position of the first bit set to 1 or 0 in a string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"bit","doc":null,"default_value":"","external_name":"bit","restriction":""},{"name":"start","doc":null,"default_value":"nil","external_name":"start","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"args_string":"(key, bit, start = nil, to = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L478","def":{"name":"bitpos","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"bit","doc":null,"default_value":"","external_name":"bit","restriction":""},{"name":"start","doc":null,"default_value":"nil","external_name":"start","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BITPOS\", key.to_s, bit.to_s] of RedisValue\nif start\n q << start.to_s\n if to\n q << to\n end\nend\ninteger_command(q)\n"}},{"id":"blpop(keys,timeout_in_seconds)-instance-method","html_id":"blpop(keys,timeout_in_seconds)-instance-method","name":"blpop","doc":"BLPOP is a blocking list pop primitive.\nIt is the blocking version of LPOP because it blocks the connection when there\nare no elements to pop from any of the given lists.\nAn element is popped from the head of the first list that is non-empty,\nwith the given keys being checked in the order that they are given.\n\nThe timeout_in_seconds argument is interpreted as an integer value specifying the maximum number of seconds to block\n\n**Return value**: Array, specifically:\n* An array of nils when no element could be popped and the timeout expired.\n* An array of two-element arrays with the first element being the name of the key where an element was popped and the second element being the value of the popped element.\n\nExample:\n\n```\nredis.blpop([\"myotherlist\", \"mylist\"], 1) # => [\"mylist\", \"hello\"]\n```","summary":"

    BLPOP is a blocking list pop primitive.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(keys, timeout_in_seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L857","def":{"name":"blpop","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = concat([\"BLPOP\"], keys)\nq << timeout_in_seconds.to_s\narray_or_nil_command(q)\n"}},{"id":"brpop(keys,timeout_in_seconds)-instance-method","html_id":"brpop(keys,timeout_in_seconds)-instance-method","name":"brpop","doc":"BRPOP is a blocking list pop primitive.\nIt is the blocking version of RPOP because it blocks the connection when there\nare no elements to pop from any of the given lists.\nAn element is popped from the tail of the first list that is non-empty,\nwith the given keys being checked in the order that they are given.\n\nThe timeout_in_seconds argument is interpreted as an integer value specifying the maximum\nnumber of seconds to block.\n\n**Return value**: Array, specifically:\n* An array of nils when no element could be popped and the timeout expired.\n* An array of two-element arrays with the first element being the name of the key where an element was popped and the second element being the value of the popped element.\n\nExample:\n\n```\nredis.brpop([\"myotherlist\", \"mylist\"], 1) # => [\"mylist\", \"world\"]\n```","summary":"

    BRPOP is a blocking list pop primitive.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(keys, timeout_in_seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L881","def":{"name":"brpop","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = concat([\"BRPOP\"], keys)\nq << timeout_in_seconds.to_s\narray_or_nil_command(q)\n"}},{"id":"brpoplpush(source,destination,timeout_in_seconds=nil)-instance-method","html_id":"brpoplpush(source,destination,timeout_in_seconds=nil)-instance-method","name":"brpoplpush","doc":"BRPOPLPUSH is the blocking variant of RPOPLPUSH.\nWhen source contains elements, this command behaves exactly like RPOPLPUSH.\n\n**Options**:\n\n* timeout_in_seconds - interpreted as an integer value specifying the maximum number of seconds to block\n\nSee RPOPLPUSH for more information.\n\n**Return value**: String, the element being popped from source and pushed to destination.\nIf timeout is reached, nil is returned.\n\nExample:\n\n```\nredis.brpoplpush(\"source\", \"destination\", 0)\n```","summary":"

    BRPOPLPUSH is the blocking variant of RPOPLPUSH.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"nil","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(source, destination, timeout_in_seconds = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L912","def":{"name":"brpoplpush","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"nil","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BRPOPLPUSH\", source.to_s, destination.to_s]\nif timeout_in_seconds\n q << timeout_in_seconds.to_s\nend\nstring_or_nil_command(q)\n"}},{"id":"decr(key)-instance-method","html_id":"decr(key)-instance-method","name":"decr","doc":"Decrements the number stored at key by one.\n\n**Return value**: Integer, the value of key after the decrement","summary":"

    Decrements the number stored at key by one.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L319","def":{"name":"decr","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"DECR\", key.to_s])"}},{"id":"decrby(key,decrement)-instance-method","html_id":"decrby(key,decrement)-instance-method","name":"decrby","doc":"Decrements the number stored at key by decrement.\n\n**Return value**: Integer, the value of key after the decrement","summary":"

    Decrements the number stored at key by decrement.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"decrement","doc":null,"default_value":"","external_name":"decrement","restriction":""}],"args_string":"(key, decrement)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L352","def":{"name":"decrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"decrement","doc":null,"default_value":"","external_name":"decrement","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"DECRBY\", key.to_s, decrement.to_s])"}},{"id":"del(keys:Array)-instance-method","html_id":"del(keys:Array)-instance-method","name":"del","doc":"Removes the specified keys.\n\n**Return value**: Integer, the number of keys that were removed.\n\nExample:\n\n```\nredis.del([\"some\", \"keys\", \"to\", \"delete\"])\n```","summary":"

    Removes the specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"args_string":"(keys : Array)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L146","def":{"name":"del","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"DEL\"], keys))"}},{"id":"del(*keys)-instance-method","html_id":"del(*keys)-instance-method","name":"del","doc":"Removes the specified keys.\n\n**Return value**: Integer, the number of keys that were removed.\n\nExample:\n\n```\nredis.del(\"some\", \"keys\", \"to\", \"delete\")\n```","summary":"

    Removes the specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L133","def":{"name":"del","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"DEL\"], keys))"}},{"id":"dump(key)-instance-method","html_id":"dump(key)-instance-method","name":"dump","doc":"Serialize the value stored at key in a Redis-specific format and return it to the user.\n\n**Return value**: String, the serialized value.","summary":"

    Serialize the value stored at key in a Redis-specific format and return it to the user.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L492","def":{"name":"dump","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"DUMP\", key.to_s])"}},{"id":"echo(message)-instance-method","html_id":"echo(message)-instance-method","name":"echo","doc":"Returns the given message.\n\nExample:\n\n```\nredis.echo(\"Hello Redis\") # => \"Hello Redis\"\n```","summary":"

    Returns the given message.

    ","abstract":false,"args":[{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"args_string":"(message)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L12","def":{"name":"echo","args":[{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"ECHO\", message.to_s])"}},{"id":"eval(script:String,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","html_id":"eval(script:String,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","name":"eval","doc":"EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter\nbuilt into Redis starting from version 2.6.0.\n\n**Return value**: Array(String), depends on the executed script\n\nExample:\n\n```\nredis.eval(\"return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}\", [\"key1\", \"key2\"], [\"first art\", \"second arg\"])\n```","summary":"

    EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.

    ","abstract":false,"args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"args_string":"(script : String, keys = [] of RedisValue, args = [] of RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1399","def":{"name":"eval","args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"EVAL\", script, keys.size.to_s], keys, args))"}},{"id":"evalsha(sha1,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","html_id":"evalsha(sha1,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","name":"evalsha","doc":"EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter\nbuilt into Redis starting from version 2.6.0.\n\n**Return value**: Array(String), depends on the executed script","summary":"

    EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.

    ","abstract":false,"args":[{"name":"sha1","doc":null,"default_value":"","external_name":"sha1","restriction":""},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"args_string":"(sha1, keys = [] of RedisValue, args = [] of RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1407","def":{"name":"evalsha","args":[{"name":"sha1","doc":null,"default_value":"","external_name":"sha1","restriction":""},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"EVALSHA\", sha1.to_s, keys.size.to_s], keys, args))"}},{"id":"exists(key)-instance-method","html_id":"exists(key)-instance-method","name":"exists","doc":"Returns if key exists.\n\n**Return value**:\n* 1 if the key exists.\n* 0 if the key does not exist.","summary":"

    Returns if key exists.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L540","def":{"name":"exists","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXISTS\", key.to_s])"}},{"id":"expire(key,seconds)-instance-method","html_id":"expire(key,seconds)-instance-method","name":"expire","doc":"Set a timeout on key.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.\n\nExample:\n\n```\nredis.expire(\"temp\", 2)\n```","summary":"

    Set a timeout on key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"seconds","doc":null,"default_value":"","external_name":"seconds","restriction":""}],"args_string":"(key, seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1475","def":{"name":"expire","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"seconds","doc":null,"default_value":"","external_name":"seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXPIRE\", key.to_s, seconds.to_s])"}},{"id":"expireat(key,unix_date)-instance-method","html_id":"expireat(key,unix_date)-instance-method","name":"expireat","doc":"EXPIREAT has the same effect and semantic as EXPIRE, but instead of\nspecifying the number of seconds representing the TTL (time to live),\nit takes an absolute Unix timestamp (seconds since January 1, 1970).\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date","doc":null,"default_value":"","external_name":"unix_date","restriction":""}],"args_string":"(key, unix_date)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1496","def":{"name":"expireat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date","doc":null,"default_value":"","external_name":"unix_date","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXPIREAT\", key.to_s, unix_date.to_s])"}},{"id":"flushall-instance-method","html_id":"flushall-instance-method","name":"flushall","doc":"Flush all databases.\n\n**Return value**: \"OK\"","summary":"

    Flush all databases.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1453","def":{"name":"flushall","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"FLUSHALL\"])"}},{"id":"flushdb-instance-method","html_id":"flushdb-instance-method","name":"flushdb","doc":"Flush the current database.\n\n**Return value**: \"OK\"","summary":"

    Flush the current database.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1446","def":{"name":"flushdb","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"FLUSHDB\"])"}},{"id":"get(key)-instance-method","html_id":"get(key)-instance-method","name":"get","doc":"Get the value of key.\n\n**Return value**: a String or nil\n\nExample:\n\n```\nredis.set(\"foo\", \"test\")\nredis.get(\"foo\") # => \"test\"\n```","summary":"

    Get the value of key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L66","def":{"name":"get","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"GET\", key.to_s])"}},{"id":"getbit(key,index)-instance-method","html_id":"getbit(key,index)-instance-method","name":"getbit","doc":"Returns the bit value at offset in the string value stored at key.\n\n**Return value**: Integer, the bit value stored at offset.","summary":"

    Returns the bit value at offset in the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"args_string":"(key, index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L447","def":{"name":"getbit","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"GETBIT\", key.to_s, index.to_s])"}},{"id":"getrange(key,start_index,end_index)-instance-method","html_id":"getrange(key,start_index,end_index)-instance-method","name":"getrange","doc":"Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).\n\n\nExample:\n\n```\nredis.set(\"foo\", \"This is a string\")\nredis.getrange(\"foo\", 0, 3) # => \"This\"\nredis.getrange(\"foo\", -3, -1) # => \"ing\"\n```","summary":"

    Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"end_index","doc":null,"default_value":"","external_name":"end_index","restriction":""}],"args_string":"(key, start_index, end_index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L387","def":{"name":"getrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"end_index","doc":null,"default_value":"","external_name":"end_index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"GETRANGE\", key.to_s, start_index.to_s, end_index.to_s])"}},{"id":"getset(key,value)-instance-method","html_id":"getset(key,value)-instance-method","name":"getset","doc":"Atomically sets key to value and returns the old value stored at key.\n\n**Return value**: String, the old value stored at key, or nil when key did not exist.\n\nExample:\n\n```\nredis.getset(\"foo\", \"new\") # => (the old value)\n```","summary":"

    Atomically sets key to value and returns the old value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L251","def":{"name":"getset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"GETSET\", key.to_s, value])"}},{"id":"hdel(key,field)-instance-method","html_id":"hdel(key,field)-instance-method","name":"hdel","doc":"Removes the specified fields from the hash stored at key.\n\n**Return value**: Integer, the number of fields that were removed from the hash,\nnot including specified but non existing fields.","summary":"

    Removes the specified fields from the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L960","def":{"name":"hdel","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HDEL\", key.to_s, field.to_s])"}},{"id":"hexists(key,field)-instance-method","html_id":"hexists(key,field)-instance-method","name":"hexists","doc":"Returns if field is an existing field in the hash stored at key.\n\n**Return value**: Integer, specifically:\n* 1 if the hash contains field.\n* 0 if the hash does not contain field, or key does not exist.","summary":"

    Returns if field is an existing field in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L969","def":{"name":"hexists","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HEXISTS\", key.to_s, field.to_s])"}},{"id":"hget(key,field)-instance-method","html_id":"hget(key,field)-instance-method","name":"hget","doc":"Returns the value associated with field in the hash stored at key.\n\n**Return value**: String, the value associated with field, or nil\n\nExample:\n\n```\nredis.hget(\"myhash\", \"a\") # => \"434\"\n```","summary":"

    Returns the value associated with field in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L944","def":{"name":"hget","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"HGET\", key.to_s, field.to_s])"}},{"id":"hgetall(key)-instance-method","html_id":"hgetall(key)-instance-method","name":"hgetall","doc":"Returns all fields and values of the hash stored at key.\n\n**Return value**: Array(String) of fields and their values stored in the hash,\nor an empty array when key does not exist.","summary":"

    Returns all fields and values of the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L952","def":{"name":"hgetall","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HGETALL\", key.to_s])"}},{"id":"hincrby(key,field,increment)-instance-method","html_id":"hincrby(key,field,increment)-instance-method","name":"hincrby","doc":"Increments the number stored at field in the hash stored at key by increment.\n\n**Return value**: Integer, the value at field after the increment operation.\n\nExample:\n\n```\nredis.hincrby(\"myhash\", \"field1\", \"3\") # => 4\n```","summary":"

    Increments the number stored at field in the hash stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, field, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L982","def":{"name":"hincrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HINCRBY\", key.to_s, field.to_s, increment.to_s])"}},{"id":"hincrbyfloat(key,field,increment)-instance-method","html_id":"hincrbyfloat(key,field,increment)-instance-method","name":"hincrbyfloat","doc":"Increment the specified field of an hash stored at key,\nand representing a floating point number, by the specified increment.\n\n**Return value**: String, the value at field after the increment operation.","summary":"

    Increment the specified field of an hash stored at key, and representing a floating point number, by the specified increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, field, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L990","def":{"name":"hincrbyfloat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"HINCRBYFLOAT\", key.to_s, field.to_s, increment.to_s])"}},{"id":"hkeys(key)-instance-method","html_id":"hkeys(key)-instance-method","name":"hkeys","doc":"Returns all field names in the hash stored at key.\n\n**Return value**: Array(String) - list of fields in the hash, or an empty list when key does not exist.","summary":"

    Returns all field names in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L997","def":{"name":"hkeys","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HKEYS\", key.to_s])"}},{"id":"hlen(key)-instance-method","html_id":"hlen(key)-instance-method","name":"hlen","doc":"Returns the number of fields contained in the hash stored at key.\n\n**Return value**: Integer, the number of fields in the hash, or 0 when key does not exist.","summary":"

    Returns the number of fields contained in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1004","def":{"name":"hlen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HLEN\", key.to_s])"}},{"id":"hmget(key,*fields)-instance-method","html_id":"hmget(key,*fields)-instance-method","name":"hmget","doc":"Returns the values associated with the specified fields in the hash stored at key.\n\n**Return value**: Array(String), the list of values associated with the given fields, in the same order as they are requested.","summary":"

    Returns the values associated with the specified fields in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":""}],"args_string":"(key, *fields)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1011","def":{"name":"hmget","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"HMGET\", key.to_s], fields))"}},{"id":"hmset(key,hash)-instance-method","html_id":"hmset(key,hash)-instance-method","name":"hmset","doc":"Sets the specified fields to their respective values in the hash stored at key.\n\n**Return value**: \"OK\"","summary":"

    Sets the specified fields to their respective values in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"args_string":"(key, hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1018","def":{"name":"hmset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"HMSET\", key.to_s] of RedisValue\nhash.each do |field, value|\n (q << field.to_s) << value.to_s\nend\nstring_command(q)\n"}},{"id":"hscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"hscan(key,cursor,match=nil,count=nil)-instance-method","name":"hscan","doc":"```\nredis.hscan(\"myhash\", 0)\nredis.hscan(\"myhash\", 0, \"foo*\")\nredis.hscan(\"myhash\", 0, \"foo*\", 1024)\n```","summary":"

    ` redis.hscan(\"myhash\", 0) redis.hscan(\"myhash\", 0, \"foo\") redis.hscan(\"myhash\", 0, \"foo\", 1024) `

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1038","def":{"name":"hscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"HSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"hset(key,field,value)-instance-method","html_id":"hset(key,field,value)-instance-method","name":"hset","doc":"Sets field in the hash stored at key to value.\n\n**Return value**: Integer, specifically:\n* 1 if field is a new field in the hash and value was set.\n* 0 if field already exists in the hash and the value was updated.\n\nExample:\n\n```\nredis.hset(\"myhash\", \"a\", \"434\")\n```","summary":"

    Sets field in the hash stored at key to value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, field, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L931","def":{"name":"hset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HSET\", key.to_s, field.to_s, value.to_s])"}},{"id":"hsetnx(key,field,value)-instance-method","html_id":"hsetnx(key,field,value)-instance-method","name":"hsetnx","doc":"Sets field in the hash stored at key to value, only if field does not yet exist.\n\n**Return value**: Integer, specifically:\n* 1 if field is a new field in the hash and value was set.\n* 0 if field already exists in the hash and no operation was performed.","summary":"

    Sets field in the hash stored at key to value, only if field does not yet exist.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, field, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1050","def":{"name":"hsetnx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HSETNX\", key.to_s, field.to_s, value.to_s])"}},{"id":"hvals(key)-instance-method","html_id":"hvals(key)-instance-method","name":"hvals","doc":"Returns all values in the hash stored at key.\n\n**Return value**: Array(String), the list of values in the hash, or an empty list when key does not exist.","summary":"

    Returns all values in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1057","def":{"name":"hvals","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HVALS\", key.to_s])"}},{"id":"incr(key)-instance-method","html_id":"incr(key)-instance-method","name":"incr","doc":"Increments the number stored at key by one.\n\n**Return value**: Integer: the value of key after the increment\n\nExample:\n\n```\nredis.set(\"foo\", \"3\")\nredis.incr(\"foo\") # => 4\n```","summary":"

    Increments the number stored at key by one.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L312","def":{"name":"incr","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"INCR\", key.to_s])"}},{"id":"incrby(key,increment)-instance-method","html_id":"incrby(key,increment)-instance-method","name":"incrby","doc":"Increments the number stored at key by increment.\n\n**Return value**: Integer, the value of key after the increment\n\nExample:\n\n```\nredis.incrby(\"foo\", 4)\n```","summary":"

    Increments the number stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L332","def":{"name":"incrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"INCRBY\", key.to_s, increment.to_s])"}},{"id":"incrbyfloat(key,increment)-instance-method","html_id":"incrbyfloat(key,increment)-instance-method","name":"incrbyfloat","doc":"Increment the string representing a floating point number stored at key by the specified increment.\n\n**Return value**: Integer, the value of key after the increment\n\nExample:\n\n```\nredis.incrbyfloat(\"foo\", 2.5)\n```","summary":"

    Increment the string representing a floating point number stored at key by the specified increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L345","def":{"name":"incrbyfloat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"INCRBYFLOAT\", key.to_s, increment.to_s])"}},{"id":"info(section:String?=nil)-instance-method","html_id":"info(section:String?=nil)-instance-method","name":"info","doc":"The INFO command returns information and statistics about the server.\n\n**Return value**: A hash with the server information","summary":"

    The INFO command returns information and statistics about the server.

    ","abstract":false,"args":[{"name":"section","doc":null,"default_value":"nil","external_name":"section","restriction":"String | ::Nil"}],"args_string":"(section : String? = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1674","def":{"name":"info","args":[{"name":"section","doc":null,"default_value":"nil","external_name":"section","restriction":"String | ::Nil"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"arr = [\"INFO\"]\nif section\n arr << section\nend\nbulk = string_command(arr)\nresults = Hash(String, String).new\n(bulk.split(\"\\r\\n\")).each do |line|\n if line.empty? || (line[0] == '#')\n next\n end\n key, val = line.split(\":\")\n results[key] = val\nend\nresults\n"}},{"id":"keys(pattern)-instance-method","html_id":"keys(pattern)-instance-method","name":"keys","doc":"Returns all keys matching pattern.\n\n**Return value**: Array(String), array of keys matching pattern.\n\nExample:\n\n```\nredis.keys(\"callmemaybe\")\n```","summary":"

    Returns all keys matching pattern.

    ","abstract":false,"args":[{"name":"pattern","doc":null,"default_value":"","external_name":"pattern","restriction":""}],"args_string":"(pattern)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L553","def":{"name":"keys","args":[{"name":"pattern","doc":null,"default_value":"","external_name":"pattern","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"KEYS\", pattern.to_s])"}},{"id":"lindex(key,index)-instance-method","html_id":"lindex(key,index)-instance-method","name":"lindex","doc":"Returns the element at index index in the list stored at key.\n\n**Return value**: String, the requested element, or nil when index is out of range.","summary":"

    Returns the element at index index in the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"args_string":"(key, index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L618","def":{"name":"lindex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"LINDEX\", key.to_s, index.to_s])"}},{"id":"linsert(key,where,pivot,value)-instance-method","html_id":"linsert(key,where,pivot,value)-instance-method","name":"linsert","doc":"Inserts value in the list stored at key either before or after the reference value pivot.\n\n**Options**:\n\n* where - either \"BEFORE\" or \"AFTER\"\n\n**Return value**: Integer, the length of the list after the insert operation, or -1 when the value pivot was not found.","summary":"

    Inserts value in the list stored at key either before or after the reference value pivot.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"where","doc":null,"default_value":"","external_name":"where","restriction":""},{"name":"pivot","doc":null,"default_value":"","external_name":"pivot","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, where, pivot, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L656","def":{"name":"linsert","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"where","doc":null,"default_value":"","external_name":"where","restriction":""},{"name":"pivot","doc":null,"default_value":"","external_name":"pivot","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LINSERT\", key.to_s, where.to_s, pivot.to_s, value.to_s])"}},{"id":"llen(key)-instance-method","html_id":"llen(key)-instance-method","name":"llen","doc":"Returns the length of the list stored at key.\n\n**Return value**: Integer, the length of the list at key.","summary":"

    Returns the length of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L611","def":{"name":"llen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LLEN\", key.to_s])"}},{"id":"lpop(key)-instance-method","html_id":"lpop(key)-instance-method","name":"lpop","doc":"Removes and returns the first element of the list stored at key.\n\n**Return value**: String, the value of the first element, or nil when key does not exist.\n\nExample:\n\n```\nredis.lpop(\"mylist\")\n```","summary":"

    Removes and returns the first element of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L638","def":{"name":"lpop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"LPOP\", key.to_s])"}},{"id":"lpush(key,*values)-instance-method","html_id":"lpush(key,*values)-instance-method","name":"lpush","doc":"Insert all the specified values at the head of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Insert all the specified values at the head of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L573","def":{"name":"lpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"LPUSH\", key.to_s], values))"}},{"id":"lpush(key,values:Array(RedisValue))-instance-method","html_id":"lpush(key,values:Array(RedisValue))-instance-method","name":"lpush","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L577","def":{"name":"lpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"LPUSH\", key.to_s], values))"}},{"id":"lpushx(key,value)-instance-method","html_id":"lpushx(key,value)-instance-method","name":"lpushx","doc":"Inserts value at the head of the list stored at key, only if key already exists and holds a list.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Inserts value at the head of the list stored at key, only if key already exists and holds a list.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L584","def":{"name":"lpushx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LPUSHX\", key.to_s, value.to_s])"}},{"id":"lrange(key,from,to)-instance-method","html_id":"lrange(key,from,to)-instance-method","name":"lrange","doc":"Returns the specified elements of the list stored at key.\n\n**Return value**: Array(String), the list of elements in the specified range.\n\nExample:\n\n```\nredis.lrange(\"mylist\", 0, 2)\n```","summary":"

    Returns the specified elements of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"","external_name":"to","restriction":""}],"args_string":"(key, from, to)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L669","def":{"name":"lrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"LRANGE\", key.to_s, from.to_s, to.to_s])"}},{"id":"lrem(key,count,value)-instance-method","html_id":"lrem(key,count,value)-instance-method","name":"lrem","doc":"Removes the first count occurrences of elements equal to value from the list stored at key.\n\n**Return value**: Integer, the number of removed elements.\n\nExample:\n\n```\nredis.lrem(\"mylist\", 1, \"my\")\n```","summary":"

    Removes the first count occurrences of elements equal to value from the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"","external_name":"count","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, count, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L604","def":{"name":"lrem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"","external_name":"count","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LREM\", key.to_s, count.to_s, value.to_s])"}},{"id":"lset(key,index,value)-instance-method","html_id":"lset(key,index,value)-instance-method","name":"lset","doc":"Sets the list element at index to value.\n\n**Return value**: \"OK\"","summary":"

    Sets the list element at index to value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L625","def":{"name":"lset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"LSET\", key.to_s, index.to_s, value.to_s])"}},{"id":"ltrim(key,start,stop)-instance-method","html_id":"ltrim(key,start,stop)-instance-method","name":"ltrim","doc":"Trim an existing list so that it will contain only the specified range of elements specified.\n\n**Return value**: \"OK\"","summary":"

    Trim an existing list so that it will contain only the specified range of elements specified.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L676","def":{"name":"ltrim","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"LTRIM\", key.to_s, start.to_s, stop.to_s])"}},{"id":"mget(*keys)-instance-method","html_id":"mget(*keys)-instance-method","name":"mget","doc":"Returns the values of all specified keys.\n\n**Return value**: Array(String), the list of values at the specified keys.\nFor every key that does not hold a string value or does not exist, nil is returned.\n\nExample:\n\n```\nredis.set(\"foo1\", \"test1\")\nredis.set(\"foo2\", \"test2\")\nredis.mget(\"foo1\", \"foo2\") # => [\"test1\", \"test2\"]\n```","summary":"

    Returns the values of all specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L219","def":{"name":"mget","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"MGET\"], keys))"}},{"id":"mget(keys:Array)-instance-method","html_id":"mget(keys:Array)-instance-method","name":"mget","doc":null,"summary":null,"abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"args_string":"(keys : Array)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L223","def":{"name":"mget","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"MGET\"], keys))"}},{"id":"mset(hash:Hash)-instance-method","html_id":"mset(hash:Hash)-instance-method","name":"mset","doc":"Sets the given keys to their respective values as defined in the hash.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.mset({\"foo1\": \"bar1\", \"foo2\": \"bar2\"})\n```","summary":"

    Sets the given keys to their respective values as defined in the hash.

    ","abstract":false,"args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":"Hash"}],"args_string":"(hash : Hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L236","def":{"name":"mset","args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":"Hash"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"MSET\"] of RedisValue\nhash.each do |key, value|\n (q << key.to_s) << value.to_s\nend\nstring_command(q)\n"}},{"id":"msetnx(hash)-instance-method","html_id":"msetnx(hash)-instance-method","name":"msetnx","doc":"Sets the given keys to their respective values as defined in the hash.\nMSETNX will not perform any operation at all even if just a single key already exists.\n\n**Return value**: Integer, specifically:\n* 1 if the all the keys were set.\n* 0 if no key was set (at least one key already existed).\n\nExample:\n\n```\nredis.msetnx({\"key1\": \"hello\", \"key2\": \"there\"})\n```","summary":"

    Sets the given keys to their respective values as defined in the hash.

    ","abstract":false,"args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"args_string":"(hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L296","def":{"name":"msetnx","args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"MSETNX\"] of RedisValue\nhash.each do |key, value|\n (q << key.to_s) << value\nend\ninteger_command(q)\n"}},{"id":"object_encoding(key)-instance-method","html_id":"object_encoding(key)-instance-method","name":"object_encoding","doc":"Returns the kind of internal representation used in order to store\nthe value associated with a key.\n\n**Return value**: String: returns the kind of internal representation\nused in order to store the value associated with a key.","summary":"

    Returns the kind of internal representation used in order to store the value associated with a key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1701","def":{"name":"object_encoding","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"OBJECT\", \"ENCODING\", key.to_s])"}},{"id":"object_idletime(key)-instance-method","html_id":"object_idletime(key)-instance-method","name":"object_idletime","doc":"Returns the number of seconds since the object stored at the specified key\nis idle (not requested by read or write operations).\n\n**Return value**: Integer: returns the number of seconds\nsince the object stored at the specified key is idle\n(not requested by read or write operations).","summary":"

    Returns the number of seconds since the object stored at the specified key is idle (not requested by read or write operations).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1711","def":{"name":"object_idletime","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"OBJECT\", \"IDLETIME\", key.to_s])"}},{"id":"object_refcount(key)-instance-method","html_id":"object_refcount(key)-instance-method","name":"object_refcount","doc":"Returns the number of references of the value associated\nwith the specified key.\n\n**Return value**: Integer: returns the number of references\nof the value associated with the specified key.","summary":"

    Returns the number of references of the value associated with the specified key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1692","def":{"name":"object_refcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"OBJECT\", \"REFCOUNT\", key.to_s])"}},{"id":"persist(key)-instance-method","html_id":"persist(key)-instance-method","name":"persist","doc":"Remove the existing timeout on key, turning the key from volatile\n(a key with an expire set) to persistent (a key that will never expire\nas no timeout is associated).\n\n**Return value**: Integer, specifically:\n* 1 if the timeout was removed.\n* 0 if key does not exist or does not have an associated timeout.","summary":"

    Remove the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1517","def":{"name":"persist","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PERSIST\", key.to_s])"}},{"id":"pexpire(key,milis)-instance-method","html_id":"pexpire(key,milis)-instance-method","name":"pexpire","doc":"This command works exactly like EXPIRE but the time to live of the key is\nspecified in milliseconds instead of seconds.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"milis","doc":null,"default_value":"","external_name":"milis","restriction":""}],"args_string":"(key, milis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1485","def":{"name":"pexpire","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"milis","doc":null,"default_value":"","external_name":"milis","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PEXPIRE\", key.to_s, milis.to_s])"}},{"id":"pexpireat(key,unix_date_in_millis)-instance-method","html_id":"pexpireat(key,unix_date_in_millis)-instance-method","name":"pexpireat","doc":"PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time\nat which the key will expire is specified in milliseconds instead of seconds.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time at which the key will expire is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date_in_millis","doc":null,"default_value":"","external_name":"unix_date_in_millis","restriction":""}],"args_string":"(key, unix_date_in_millis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1506","def":{"name":"pexpireat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date_in_millis","doc":null,"default_value":"","external_name":"unix_date_in_millis","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PEXPIREAT\", key.to_s, unix_date_in_millis.to_s])"}},{"id":"pfadd(key,*values)-instance-method","html_id":"pfadd(key,*values)-instance-method","name":"pfadd","doc":"Adds all the element arguments to the HyperLogLog data structure stored at\nthe variable name specified as first argument.\n\n**Return value**: Integer: 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.\n\nExample:\n\n```\nredis.pfadd(\"hll\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\") # => 1\n```","summary":"

    Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1366","def":{"name":"pfadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"PFADD\", key.to_s], values))"}},{"id":"pfcount(*keys)-instance-method","html_id":"pfcount(*keys)-instance-method","name":"pfcount","doc":"When called with a single key, returns the approximated cardinality computed\nby the HyperLogLog data structure stored at the specified variable,\nwhich is 0 if the variable does not exist.\n\n**Return value**: Integer, the approximated number of unique elements\nobserved via PFADD.","summary":"

    When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1385","def":{"name":"pfcount","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"PFCOUNT\"], keys))"}},{"id":"pfmerge(*keys)-instance-method","html_id":"pfmerge(*keys)-instance-method","name":"pfmerge","doc":"Merge multiple HyperLogLog values into an unique value that will\napproximate the cardinality of the union of the observed Sets of the\nsource HyperLogLog structures.\n\n**Return value**: \"OK\".","summary":"

    Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1375","def":{"name":"pfmerge","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command(concat([\"PFMERGE\"], keys))"}},{"id":"ping-instance-method","html_id":"ping-instance-method","name":"ping","doc":"Returns PONG. This command is often used to test if a connection is still alive, or to measure latency.\n\nExample:\n\n```\nredis.ping # => \"PONG\"\n```","summary":"

    Returns PONG.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L23","def":{"name":"ping","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"PING\"])"}},{"id":"psetex(key,expire_in_milis,value)-instance-method","html_id":"psetex(key,expire_in_milis,value)-instance-method","name":"psetex","doc":"PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.\n\n**Return value**: \"OK\"","summary":"

    PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_milis","doc":null,"default_value":"","external_name":"expire_in_milis","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, expire_in_milis, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L271","def":{"name":"psetex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_milis","doc":null,"default_value":"","external_name":"expire_in_milis","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"PSETEX\", key.to_s, expire_in_milis.to_s, value.to_s])"}},{"id":"psubscribe(*channel_patterns)-instance-method","html_id":"psubscribe(*channel_patterns)-instance-method","name":"psubscribe","doc":"Subscribes to more channel patterns while already being in a subscription loop.","summary":"

    Subscribes to more channel patterns while already being in a subscription loop.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1621","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\nelse\n raise(Redis::Error.new(\"Must call psubscribe with a subscription block\"))\nend\nvoid_command(concat([\"PSUBSCRIBE\"], channel_patterns))\n"}},{"id":"psubscribe(*channel_patterns,&callback_setup_block:Subscription->)-instance-method","html_id":"psubscribe(*channel_patterns,&callback_setup_block:Subscription->)-instance-method","name":"psubscribe","doc":"Subscribes to channel patterns and enters a subscription loop, waiting for events.\n\nThe method yields to the given block and passes a Subscription object, on\nwhich you can set your callbacks for the event subscription.\n\nThe subscription loop will end once you unsubscribe.","summary":"

    Subscribes to channel patterns and enters a subscription loop, waiting for events.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns, &callback_setup_block : Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1605","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Subscription -> )"},"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\n raise(Redis::Error.new(\"Must call psubscribe without a subscription block when inside a subscription loop\"))\nend\nsubscription = Subscription.new\ncallback_setup_block.call(subscription)\n@strategy = Redis::Strategy::SubscriptionLoop.new(connection, subscription)\npsubscribe(*channel_patterns)\n"}},{"id":"pttl(key)-instance-method","html_id":"pttl(key)-instance-method","name":"pttl","doc":"Like TTL this command returns the remaining time to live of a key that has\nan expire set, with the sole difference that TTL returns the amount of\nremaining time in seconds while PTTL returns it in milliseconds.\n\n**Return value**: Integer, the TTL in milliseconds, or a negative value in order to signal an error.","summary":"

    Like TTL this command returns the remaining time to live of a key that has an expire set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1534","def":{"name":"pttl","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PTTL\", key.to_s])"}},{"id":"publish(channel,message)-instance-method","html_id":"publish(channel,message)-instance-method","name":"publish","doc":"Posts a message to the given channel.\n\n**Return value**: Integer, the number of clients that received the message.\n\nExample:\n\n```\nredis.publish(\"mychannel\", \"some message\")\n```","summary":"

    Posts a message to the given channel.

    ","abstract":false,"args":[{"name":"channel","doc":null,"default_value":"","external_name":"channel","restriction":""},{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"args_string":"(channel, message)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1653","def":{"name":"publish","args":[{"name":"channel","doc":null,"default_value":"","external_name":"channel","restriction":""},{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PUBLISH\", channel.to_s, message.to_s])"}},{"id":"punsubscribe(*channel_patterns)-instance-method","html_id":"punsubscribe(*channel_patterns)-instance-method","name":"punsubscribe","doc":"Unsubscribes the client from the given patterns, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given patterns, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1640","def":{"name":"punsubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"void_command(concat([\"PUNSUBSCRIBE\"], channel_patterns))"}},{"id":"quit-instance-method","html_id":"quit-instance-method","name":"quit","doc":"Ask the server to close the connection. The connection is closed as soon as all pending replies have been written to the client.\n\n**Return value**: \"OK\"","summary":"

    Ask the server to close the connection.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L73","def":{"name":"quit","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"QUIT\"])"}},{"id":"randomkey-instance-method","html_id":"randomkey-instance-method","name":"randomkey","doc":"Return a random key from the currently selected database.","summary":"

    Return a random key from the currently selected database.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L531","def":{"name":"randomkey","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"RANDOMKEY\"])"}},{"id":"rename(old_key,new_key)-instance-method","html_id":"rename(old_key,new_key)-instance-method","name":"rename","doc":"Renames old_key to newkey.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.rename(\"old_name\", \"new_name\")\n```","summary":"

    Renames old_key to newkey.

    ","abstract":false,"args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"args_string":"(old_key, new_key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L107","def":{"name":"rename","args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"RENAME\", old_key.to_s, new_key.to_s])"}},{"id":"renamenx(old_key,new_key)-instance-method","html_id":"renamenx(old_key,new_key)-instance-method","name":"renamenx","doc":"Renames old_key to newkey if newkey does not yet exist.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.renamenx(\"old_name\", \"new_name\")\n```","summary":"

    Renames old_key to newkey if newkey does not yet exist.

    ","abstract":false,"args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"args_string":"(old_key, new_key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L120","def":{"name":"renamenx","args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"RENAMENX\", old_key.to_s, new_key.to_s])"}},{"id":"restore(key,ttl_in_milis:Int,serialized_value:String,replace=false)-instance-method","html_id":"restore(key,ttl_in_milis:Int,serialized_value:String,replace=false)-instance-method","name":"restore","doc":"Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP).\n\n**Return value**: The command returns \"OK\" on success.","summary":"

    Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"ttl_in_milis","doc":null,"default_value":"","external_name":"ttl_in_milis","restriction":"Int"},{"name":"serialized_value","doc":null,"default_value":"","external_name":"serialized_value","restriction":"String"},{"name":"replace","doc":null,"default_value":"false","external_name":"replace","restriction":""}],"args_string":"(key, ttl_in_milis : Int, serialized_value : String, replace = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L499","def":{"name":"restore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"ttl_in_milis","doc":null,"default_value":"","external_name":"ttl_in_milis","restriction":"Int"},{"name":"serialized_value","doc":null,"default_value":"","external_name":"serialized_value","restriction":"String"},{"name":"replace","doc":null,"default_value":"false","external_name":"replace","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"RESTORE\", key.to_s, ttl_in_milis.to_s, serialized_value]\nif replace\n q << \"REPLACE\"\nend\nstring_command(q)\n"}},{"id":"rpop(key)-instance-method","html_id":"rpop(key)-instance-method","name":"rpop","doc":"Removes and returns the last element of the list stored at key.\n\n**Return value**: \"OK\"","summary":"

    Removes and returns the last element of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L645","def":{"name":"rpop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"RPOP\", key.to_s])"}},{"id":"rpoplpush(source,destination)-instance-method","html_id":"rpoplpush(source,destination)-instance-method","name":"rpoplpush","doc":"Atomically returns and removes the last element (tail) of the list stored at source,\nand pushes the element at the first element (head) of the list stored at destination.\n\n**Return value**: String, the element being popped and pushed.","summary":"

    Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""}],"args_string":"(source, destination)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L891","def":{"name":"rpoplpush","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"RPOPLPUSH\", source.to_s, destination.to_s])"}},{"id":"rpush(key,*values)-instance-method","html_id":"rpush(key,*values)-instance-method","name":"rpush","doc":"Insert all the specified values at the tail of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.\n\nExample:\n\n```\nredis.rpush(\"mylist\", \"1\", \"2\", \"3\")\n```","summary":"

    Insert all the specified values at the tail of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L566","def":{"name":"rpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"RPUSH\", key.to_s], values))"}},{"id":"rpushx(key,value)-instance-method","html_id":"rpushx(key,value)-instance-method","name":"rpushx","doc":"Inserts value at the tail of the list stored at key, only if key already exists and holds a list.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Inserts value at the tail of the list stored at key, only if key already exists and holds a list.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L591","def":{"name":"rpushx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"RPUSHX\", key.to_s, value.to_s])"}},{"id":"sadd(key,*values)-instance-method","html_id":"sadd(key,*values)-instance-method","name":"sadd","doc":"Add the specified members to the set stored at key.\n\n**Return value**: Integer, the number of elements that were added to the set, not including all the elements already present into the set.","summary":"

    Add the specified members to the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L683","def":{"name":"sadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SADD\", key.to_s], values))"}},{"id":"sadd(key,values:Array(RedisValue))-instance-method","html_id":"sadd(key,values:Array(RedisValue))-instance-method","name":"sadd","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L687","def":{"name":"sadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SADD\", key.to_s], values))"}},{"id":"scan(cursor,match=nil,count=nil)-instance-method","html_id":"scan(cursor,match=nil,count=nil)-instance-method","name":"scan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array of String, a list of keys.\n\nExample:\n\n```\nredis.scan(0)\nredis.scan(0, \"foo*\")\nredis.scan(0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L523","def":{"name":"scan","args":[{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SCAN\", cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"scard(key)-instance-method","html_id":"scard(key)-instance-method","name":"scard","doc":"Returns the set cardinality (number of elements) of the set stored at key.","summary":"

    Returns the set cardinality (number of elements) of the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L725","def":{"name":"scard","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SCARD\", key.to_s])"}},{"id":"script_exists(sha1_array:Array(Reference))-instance-method","html_id":"script_exists(sha1_array:Array(Reference))-instance-method","name":"script_exists","doc":"Returns information about the existence of the scripts in the script cache.\n\n**Return value**: The command returns an array of integers that correspond\nto the specified SHA1 digest arguments.\nFor every corresponding SHA1 digest of a script that actually exists\nin the script cache, an 1 is returned, otherwise 0 is returned.","summary":"

    Returns information about the existence of the scripts in the script cache.

    ","abstract":false,"args":[{"name":"sha1_array","doc":null,"default_value":"","external_name":"sha1_array","restriction":"Array(Reference)"}],"args_string":"(sha1_array : Array(Reference))","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1439","def":{"name":"script_exists","args":[{"name":"sha1_array","doc":null,"default_value":"","external_name":"sha1_array","restriction":"Array(Reference)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_array_command(concat([\"SCRIPT\", \"EXISTS\"], sha1_array))"}},{"id":"script_flush-instance-method","html_id":"script_flush-instance-method","name":"script_flush","doc":"Flush the Lua scripts cache.\n\n**Return value**: \"OK\"","summary":"

    Flush the Lua scripts cache.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1460","def":{"name":"script_flush","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"FLUSH\"])"}},{"id":"script_kill-instance-method","html_id":"script_kill-instance-method","name":"script_kill","doc":"Kills the currently executing Lua script, assuming no write operation was\nyet performed by the script.\n\n**Return value**: \"OK\"","summary":"

    Kills the currently executing Lua script, assuming no write operation was yet performed by the script.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1429","def":{"name":"script_kill","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"KILL\"])"}},{"id":"script_load(script:String)-instance-method","html_id":"script_load(script:String)-instance-method","name":"script_load","doc":"Load a script into the scripts cache, without executing it.\n\n**Return value**: String, the SHA1 digest of the script\nadded into the script cache.\n\nExample:\n\n```\nredis.script_load(\"return {KEYS[1],ARGV[1]}\") # => \"a191862bfe0bd3bec995befcd060582bf4bdbd77\"\n```","summary":"

    Load a script into the scripts cache, without executing it.

    ","abstract":false,"args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"}],"args_string":"(script : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1421","def":{"name":"script_load","args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"LOAD\", script])"}},{"id":"sdiff(*keys)-instance-method","html_id":"sdiff(*keys)-instance-method","name":"sdiff","doc":"Returns the members of the set resulting from the difference between the first set and all the successive sets.\n\n**Return value**: Array(String), a list with members of the resulting set.","summary":"

    Returns the members of the set resulting from the difference between the first set and all the successive sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L732","def":{"name":"sdiff","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"SDIFF\"], keys))"}},{"id":"sdiffstore(destination,*keys)-instance-method","html_id":"sdiffstore(destination,*keys)-instance-method","name":"sdiffstore","doc":"This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(destination, *keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L739","def":{"name":"sdiffstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SDIFFSTORE\", destination.to_s], keys))"}},{"id":"select(database_number)-instance-method","html_id":"select(database_number)-instance-method","name":"select","doc":"Select the DB with having the specified zero-based numeric index.\n\n**Return value**: \"OK\"","summary":"

    Select the DB with having the specified zero-based numeric index.

    ","abstract":false,"args":[{"name":"database_number","doc":null,"default_value":"","external_name":"database_number","restriction":""}],"args_string":"(database_number)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L94","def":{"name":"select","args":[{"name":"database_number","doc":null,"default_value":"","external_name":"database_number","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SELECT\", database_number.to_s])"}},{"id":"set(key,value,ex=nil,px=nil,nx=nil,xx=nil)-instance-method","html_id":"set(key,value,ex=nil,px=nil,nx=nil,xx=nil)-instance-method","name":"set","doc":"Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type. Any previous time to live associated with the key is discarded on successful SET operation.\n\n**Options**:\n\n* Starting with Redis 2.6.12 SET supports a set of options that modify its behavior:\n* ex -- Set the specified expire time, in seconds.\n* px -- Set the specified expire time, in milliseconds.\n* nx -- Only set the key if it does not already exist.\n* xx -- Only set the key if it already exist.\n\n**Return value**:\n* OK if SET was executed correctly.\n* Null reply: nil is returned if the SET operation was not performed because the user specified the NX or XX option but the condition was not met.\n\nExample:\n\n```\nredis.set(\"foo\", \"test\")\nredis.set(\"bar\", \"test\", ex: 7)\n```","summary":"

    Set key to hold the string value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""},{"name":"ex","doc":null,"default_value":"nil","external_name":"ex","restriction":""},{"name":"px","doc":null,"default_value":"nil","external_name":"px","restriction":""},{"name":"nx","doc":null,"default_value":"nil","external_name":"nx","restriction":""},{"name":"xx","doc":null,"default_value":"nil","external_name":"xx","restriction":""}],"args_string":"(key, value, ex = nil, px = nil, nx = nil, xx = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L47","def":{"name":"set","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""},{"name":"ex","doc":null,"default_value":"nil","external_name":"ex","restriction":""},{"name":"px","doc":null,"default_value":"nil","external_name":"px","restriction":""},{"name":"nx","doc":null,"default_value":"nil","external_name":"nx","restriction":""},{"name":"xx","doc":null,"default_value":"nil","external_name":"xx","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SET\", key.to_s, value.to_s]\nif ex\n (q << \"EX\") << ex.to_s\nend\nif px\n (q << \"PX\") << px.to_s\nend\nif nx\n (q << \"NX\") << nx.to_s\nend\nif xx\n (q << \"XX\") << xx.to_s\nend\nstring_or_nil_command(q)\n"}},{"id":"setbit(key,index,value)-instance-method","html_id":"setbit(key,index,value)-instance-method","name":"setbit","doc":"Sets or clears the bit at offset in the string value stored at key.\n\n**Return value**: Integer: the original bit value stored at offset.\n\nExample:\n\n```\nredis.setbit(\"mykey\", 7, 1)\n```","summary":"

    Sets or clears the bit at offset in the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L460","def":{"name":"setbit","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETBIT\", key.to_s, index.to_s, value.to_s])"}},{"id":"setex(key,expire_in_seconds,value)-instance-method","html_id":"setex(key,expire_in_seconds,value)-instance-method","name":"setex","doc":"Set key to hold the string value and set key to timeout after a given number of seconds.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.setex(\"foo\", 3, \"bar\")\n```","summary":"

    Set key to hold the string value and set key to timeout after a given number of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_seconds","doc":null,"default_value":"","external_name":"expire_in_seconds","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, expire_in_seconds, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L264","def":{"name":"setex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_seconds","doc":null,"default_value":"","external_name":"expire_in_seconds","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SETEX\", key.to_s, expire_in_seconds.to_s, value.to_s])"}},{"id":"setnx(key,value)-instance-method","html_id":"setnx(key,value)-instance-method","name":"setnx","doc":"Set key to hold string value if key does not exist.\n\n**Return value**: Integer, specifically:\n* 1 if the key was set\n* 0 if the key was not set","summary":"

    Set key to hold string value if key does not exist.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L280","def":{"name":"setnx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETNX\", key.to_s, value.to_s])"}},{"id":"setrange(key,start_index,value)-instance-method","html_id":"setrange(key,start_index,value)-instance-method","name":"setrange","doc":"Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.\n\n**Return value**: Integer, the length of the string after it was modified by the command.\n\nExample:\n\n```\nredis.setrange(\"foo\", 6, \"Redis\")\n```","summary":"

    Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, start_index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L400","def":{"name":"setrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETRANGE\", key.to_s, start_index.to_s, value.to_s])"}},{"id":"sinter(*keys)-instance-method","html_id":"sinter(*keys)-instance-method","name":"sinter","doc":"Returns the members of the set resulting from the intersection of all the given sets.\n\n**Return value**: Array(String), an array with members of the resulting set.","summary":"

    Returns the members of the set resulting from the intersection of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L746","def":{"name":"sinter","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"SINTER\"], keys))"}},{"id":"sinterstore(destination_key,*keys)-instance-method","html_id":"sinterstore(destination_key,*keys)-instance-method","name":"sinterstore","doc":"This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.\n\nExample:\n\n```\nredis.sinterstore(\"destination\", \"key1\", \"key2\")\n```","summary":"

    This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(destination_key, *keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L759","def":{"name":"sinterstore","args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SINTERSTORE\", destination_key.to_s], keys))"}},{"id":"sismember(key,value)-instance-method","html_id":"sismember(key,value)-instance-method","name":"sismember","doc":"Returns if member is a member of the set stored at key.\n\n**Return value**: Integer, specifically:\n* 1 if the element is a member of the set.\n* 0 if the element is not a member of the set, or if key does not exist.","summary":"

    Returns if member is a member of the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L703","def":{"name":"sismember","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SISMEMBER\", key.to_s, value.to_s])"}},{"id":"smembers(key)-instance-method","html_id":"smembers(key)-instance-method","name":"smembers","doc":"Returns all the members of the set value stored at key.\n\n**Return value**: Array(String), all elements of the set.","summary":"

    Returns all the members of the set value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L694","def":{"name":"smembers","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"SMEMBERS\", key.to_s])"}},{"id":"smove(source,destination,member)-instance-method","html_id":"smove(source,destination,member)-instance-method","name":"smove","doc":"Move member from the set at source to the set at destination.\n\n**Return value**: Integer, specifically:\n* 1 if the element is moved.\n* 0 if the element is not a member of source and no operation was performed.","summary":"

    Move member from the set at source to the set at destination.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(source, destination, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L768","def":{"name":"smove","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SMOVE\", source.to_s, destination.to_s, member.to_s])"}},{"id":"sort(key,by=nil,limit=nil,get:Array(RedisValue)?=nil,order="ASC",alpha=false,store=nil)-instance-method","html_id":"sort(key,by=nil,limit=nil,get:Array(RedisValue)?=nil,order=&quot;ASC&quot;,alpha=false,store=nil)-instance-method","name":"sort","doc":"Returns or stores the elements contained in the list, set or sorted set at key.\n\n**Options**:\n\n* by - pattern for sorting by external keys\n* limit - Array of 2 strings [offset, count]\n* get - pattern for retrieving external keys\n* order - either 'ASC' or 'DESC'\n* alpha - true to sort lexicographically\n* store - key of destination list to store the result in\n\n**Return value**: Array(String), the list of sorted elements.\n\nExample:\n\n```\nredis.sort(\"mylist\") # => [...]\nredis.sort(\"mylist\", order: \"DESC\") # => [...]\n```","summary":"

    Returns or stores the elements contained in the list, set or sorted set at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"by","doc":null,"default_value":"nil","external_name":"by","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"get","doc":null,"default_value":"nil","external_name":"get","restriction":"Array(RedisValue) | ::Nil"},{"name":"order","doc":null,"default_value":"\"ASC\"","external_name":"order","restriction":""},{"name":"alpha","doc":null,"default_value":"false","external_name":"alpha","restriction":""},{"name":"store","doc":null,"default_value":"nil","external_name":"store","restriction":""}],"args_string":"(key, by = nil, limit = nil, get : Array(RedisValue)? = nil, order = "ASC", alpha = false, store = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L169","def":{"name":"sort","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"by","doc":null,"default_value":"nil","external_name":"by","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"get","doc":null,"default_value":"nil","external_name":"get","restriction":"Array(RedisValue) | ::Nil"},{"name":"order","doc":null,"default_value":"\"ASC\"","external_name":"order","restriction":""},{"name":"alpha","doc":null,"default_value":"false","external_name":"alpha","restriction":""},{"name":"store","doc":null,"default_value":"nil","external_name":"store","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SORT\", key.to_s]\nif by\n (q << \"BY\") << by.to_s\nend\nif limit\n if limit.size != 2\n raise(Error.new(\"limit must be an array of 2 elements (offset, count)\"))\n end\n offset, count = limit\n ((q << \"LIMIT\") << offset.to_s) << count.to_s\nend\nif get\n get.each do |pattern|\n (q << \"GET\") << pattern\n end\nend\nif order\n _order = order.upcase\n if [\"ASC\", \"DESC\"].includes?(_order)\n else\n raise(Error.new(\"Bad order #{order}\"))\n end\n q << _order\nend\nif alpha\n q << \"ALPHA\"\nend\nif store\n (q << \"STORE\") << store.to_s\nend\nstring_array_or_integer_command(q)\n"}},{"id":"spop(key,count=nil)-instance-method","html_id":"spop(key,count=nil)-instance-method","name":"spop","doc":"Removes and returns one or more random elements from the set value store at key.\n\nThe count argument will be available in a later Redis version and is not available in 2.6, 2.8, 3.0\n\n**Return value**: The removed element, or nil when key does not exist.","summary":"

    Removes and returns one or more random elements from the set value store at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L777","def":{"name":"spop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SPOP\", key.to_s]\nif count\n q << count.to_s\nend\nstring_array_or_string_or_nil_command(q)\n"}},{"id":"srandmember(key,count=nil)-instance-method","html_id":"srandmember(key,count=nil)-instance-method","name":"srandmember","doc":"When called with just the key argument, return a random element from the set value stored at key.\n\n**Options**:\n\n* count - Starting from Redis version 2.6, when called with the additional count argument, return an array of count distinct elements if count is positive. If called with a negative count the behavior changes and the command is allowed to return the same element multiple times.\n\n**Return value**:\n* String: without the additional count argument the command returns a Bulk Reply with the randomly selected element, or nil when key does not exist.\n* Array: when the additional count argument is passed the command returns an array of elements, or an empty array when key does not exist.","summary":"

    When called with just the key argument, return a random element from the set value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L795","def":{"name":"srandmember","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SRANDMEMBER\", key.to_s]\nif count\n q << count.to_s\nend\nstring_array_or_string_or_nil_command(q)\n"}},{"id":"srem(key,values:Array(RedisValue))-instance-method","html_id":"srem(key,values:Array(RedisValue))-instance-method","name":"srem","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L720","def":{"name":"srem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SREM\", key.to_s], values))"}},{"id":"srem(key,*values)-instance-method","html_id":"srem(key,*values)-instance-method","name":"srem","doc":"Remove the specified members from the set stored at key.\n\n**Return value**: Integer, The number of members that were removed from the set, not including non existing members.\n\nExample:\n\n```\nredis.srem(\"myset\", \"Hello\")\n```","summary":"

    Remove the specified members from the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L716","def":{"name":"srem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SREM\", key.to_s], values))"}},{"id":"sscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"sscan(key,cursor,match=nil,count=nil)-instance-method","name":"sscan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array(String), a list of Set members.\n\nExample:\n\n```\nredis.sscan(\"myset\", 0)\nredis.sscan(\"myset\", 0, \"foo*\")\nredis.sscan(\"myset\", 0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L819","def":{"name":"sscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"strlen(key)-instance-method","html_id":"strlen(key)-instance-method","name":"strlen","doc":"Returns the length of the string value stored at key.\n\n**Return value**: Integer, the length of the string at key, or 0 when key does not exist.","summary":"

    Returns the length of the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L373","def":{"name":"strlen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"STRLEN\", key.to_s])"}},{"id":"subscribe(*channels,&callback_setup_block:Subscription->)-instance-method","html_id":"subscribe(*channels,&callback_setup_block:Subscription->)-instance-method","name":"subscribe","doc":"Subscribes to channels and enters a subscription loop, waiting for events.\n\nThe method yields to the given block and passes a Subscription object, on\nwhich you can set your callbacks for the event subscription.\n\nThe subscription loop will end once you unsubscribe.\n\nSee also: `Subscription` class\nSee also: Example `subscribe.cr`\n\nExample:\n\n```\nredis.subscribe(\"mychannel\") do |on|\n on.message do |channel, message|\n puts \"Received message: #{message}\"\n if message == \"goodbye pal\"\n redis.unsubscribe\n end\n end\nend\n```","summary":"

    Subscribes to channels and enters a subscription loop, waiting for events.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels, &callback_setup_block : Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1574","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Subscription -> )"},"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\n raise(Redis::Error.new(\"Must call subscribe without a subscription block when already inside a subscription loop\"))\nend\nsubscription = Subscription.new\ncallback_setup_block.call(subscription)\n@strategy = Redis::Strategy::SubscriptionLoop.new(connection, subscription)\nsubscribe(*channels)\n"}},{"id":"subscribe(*channels)-instance-method","html_id":"subscribe(*channels)-instance-method","name":"subscribe","doc":"Subscribes to more channels while already being in a subscription loop.","summary":"

    Subscribes to more channels while already being in a subscription loop.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1590","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\nelse\n raise(Redis::Error.new(\"Must call subscribe with a subscription block\"))\nend\nvoid_command(concat([\"SUBSCRIBE\"], channels))\n"}},{"id":"sunion(*keys)-instance-method","html_id":"sunion(*keys)-instance-method","name":"sunion","doc":"Returns the members of the set resulting from the union of all the given sets.\n\n**Return value**: Array(String), with members of the resulting set.","summary":"

    Returns the members of the set resulting from the union of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L829","def":{"name":"sunion","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"SUNION\"], keys))"}},{"id":"sunionstore(destination,*keys)-instance-method","html_id":"sunionstore(destination,*keys)-instance-method","name":"sunionstore","doc":"This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(destination, *keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L836","def":{"name":"sunionstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SUNIONSTORE\", destination.to_s], keys))"}},{"id":"ttl(key)-instance-method","html_id":"ttl(key)-instance-method","name":"ttl","doc":"Returns the remaining time to live of a key that has a timeout.\n\n**Return value**: Integer: TTL in seconds, or a negative value in order to\nsignal an error (see the description above).","summary":"

    Returns the remaining time to live of a key that has a timeout.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1525","def":{"name":"ttl","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"TTL\", key.to_s])"}},{"id":"type(key)-instance-method","html_id":"type(key)-instance-method","name":"type","doc":"Returns the string representation of the type of the value stored at key.\n\n**Return value**: String, the type of key, or none when key does not exist.\n\nExample:\n\n```\nredis.set(\"foo\", 3)\nredis.type(\"foo\") # => \"string\"\n```","summary":"

    Returns the string representation of the type of the value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1548","def":{"name":"type","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"TYPE\", key.to_s])"}},{"id":"unsubscribe(*channels)-instance-method","html_id":"unsubscribe(*channels)-instance-method","name":"unsubscribe","doc":"Unsubscribes the client from the given channels, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given channels, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1635","def":{"name":"unsubscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"void_command(concat([\"UNSUBSCRIBE\"], channels))"}},{"id":"unwatch-instance-method","html_id":"unwatch-instance-method","name":"unwatch","doc":"Flushes all the previously watched keys for a transaction.\n\n**Return value**: \"OK\"","summary":"

    Flushes all the previously watched keys for a transaction.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1667","def":{"name":"unwatch","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"UNWATCH\"])"}},{"id":"watch(*keys)-instance-method","html_id":"watch(*keys)-instance-method","name":"watch","doc":"Marks the given keys to be watched for conditional execution of a transaction.\n\n**Return value**: \"OK\"","summary":"

    Marks the given keys to be watched for conditional execution of a transaction.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1660","def":{"name":"watch","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command(concat([\"WATCH\"], keys))"}},{"id":"zadd(key,scores_and_members:Array(RedisValue))-instance-method","html_id":"zadd(key,scores_and_members:Array(RedisValue))-instance-method","name":"zadd","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":"Array(RedisValue)"}],"args_string":"(key, scores_and_members : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1079","def":{"name":"zadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if (scores_and_members.size % 2) > 0\n raise(Error.new(\"zadd expects an array of scores mapped to members\"))\nend\ninteger_command(concat([\"ZADD\", key.to_s], scores_and_members))\n"}},{"id":"zadd(key,*scores_and_members)-instance-method","html_id":"zadd(key,*scores_and_members)-instance-method","name":"zadd","doc":"Adds all the specified members with the specified scores to the sorted set stored at key.\n\n**Return value**: Integer, the number of elements added to the sorted sets, not including elements already existing for which the score was updated.\n\nExample:\n\n```\nredis.zadd(\"myzset\", 1, \"one\")\nredis.zadd(\"myzset\", 2, \"two\", 3, \"three\")\n```","summary":"

    Adds all the specified members with the specified scores to the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":""}],"args_string":"(key, *scores_and_members)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1071","def":{"name":"zadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if (scores_and_members.size % 2) > 0\n raise(Error.new(\"zadd expects an array of scores mapped to members\"))\nend\ninteger_command(concat([\"ZADD\", key.to_s], scores_and_members))\n"}},{"id":"zcard(key)-instance-method","html_id":"zcard(key)-instance-method","name":"zcard","doc":"Returns the sorted set cardinality (number of elements) of the sorted set stored at key.\n\n**Return value**: Integer, the cardinality (number of elements) of the sorted set, or 0 if key does not exist.","summary":"

    Returns the sorted set cardinality (number of elements) of the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1111","def":{"name":"zcard","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZCARD\", key.to_s])"}},{"id":"zcount(key,min,max)-instance-method","html_id":"zcount(key,min,max)-instance-method","name":"zcount","doc":"Returns the number of elements in the sorted set at key with a score between min and max.\n\n**Return value**: Integer, the number of elements in the specified score range.","summary":"

    Returns the number of elements in the sorted set at key with a score between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1125","def":{"name":"zcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZCOUNT\", key.to_s, min.to_s, max.to_s])"}},{"id":"zincrby(key,increment,member)-instance-method","html_id":"zincrby(key,increment,member)-instance-method","name":"zincrby","doc":"Increments the score of member in the sorted set stored at key by increment.\n\n**Return value**: String, the new score of member (a double precision floating point number represented as String).","summary":"

    Increments the score of member in the sorted set stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, increment, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1139","def":{"name":"zincrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"ZINCRBY\", key.to_s, increment.to_s, member.to_s])"}},{"id":"zinterstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","html_id":"zinterstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","name":"zinterstore","doc":"Computes the intersection of numkeys sorted sets given by the specified keys,\nand stores the result in destination.\n\n**Options**:\n\n* weights - nil or Array(String): Using the WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set.\n* aggregate - With the AGGREGATE option, it is possible to specify how the results of the union are aggregated.\n\n**Return value**: Integer, the number of elements in the resulting sorted set at destination.\n\nExample:\n\n```\nredis.zinterstore(\"zset3\", [\"zset1\", \"zset2\"], weights: [2, 3])\n```","summary":"

    Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"args_string":"(destination, keys : Array, weights = nil, aggregate = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1184","def":{"name":"zinterstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"numkeys = keys.size\nq = concat([\"ZINTERSTORE\", destination.to_s, numkeys.to_s], keys)\nif weights\n q << \"WEIGHTS\"\n concat(q, weights)\nend\nif aggregate\n (q << \"AGGREGATE\") << aggregate.to_s\nend\ninteger_command(q)\n"}},{"id":"zlexcount(key,min,max)-instance-method","html_id":"zlexcount(key,min,max)-instance-method","name":"zlexcount","doc":"When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.\n\n**Return value**: Integer, the number of elements in the specified score range.","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1132","def":{"name":"zlexcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZLEXCOUNT\", key.to_s, min.to_s, max.to_s])"}},{"id":"zrange(key,start,stop,with_scores=false)-instance-method","html_id":"zrange(key,start,stop,with_scores=false)-instance-method","name":"zrange","doc":"Returns the specified range of elements in the sorted set stored at key.\n\n**Options**:\n\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), list of elements in the specified range (optionally with their scores, in case the with_scores option is true).\n\nExample:\n\n```\nredis.zrange(\"myzset\", 0, -1, with_scores: true) # => [\"one\", \"1\", \"uno\", \"1\", \"two\", \"2\", \"three\", \"3\"]\n```","summary":"

    Returns the specified range of elements in the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, start, stop, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1100","def":{"name":"zrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGE\", key.to_s, start.to_s, stop.to_s]\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrangebylex(key,min,max,limit=nil)-instance-method","html_id":"zrangebylex(key,min,max,limit=nil)-instance-method","name":"zrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command returns all the\nelements in the sorted set at key with a value between min and max.\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n\n**Return value**:","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"args_string":"(key, min, max, limit = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1227","def":{"name":"zrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGEBYLEX\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nstring_array_command(q)\n"}},{"id":"zrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","html_id":"zrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","name":"zrangebyscore","doc":"Returns all the elements in the sorted set at key with a score between\nmax and min (including elements with score equal to max or min).\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified score range (optionally with their scores).","summary":"

    Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, min, max, limit = nil, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1244","def":{"name":"zrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGEBYSCORE\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrank(key,member)-instance-method","html_id":"zrank(key,member)-instance-method","name":"zrank","doc":"Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.\n\n**Return value**:\n* If member exists in the sorted set, Integer: the rank of member.\n* If member does not exist in the sorted set or key does not exist: nil.","summary":"

    Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1155","def":{"name":"zrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"ZRANK\", key.to_s, member.to_s])"}},{"id":"zrem(key,member)-instance-method","html_id":"zrem(key,member)-instance-method","name":"zrem","doc":"Removes the specified members from the sorted set stored at key.\n\n**Return value**: Integer, the number of members removed from the sorted set, not including non existing members.","summary":"

    Removes the specified members from the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1146","def":{"name":"zrem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREM\", key.to_s, member.to_s])"}},{"id":"zremrangebylex(key,min,max)-instance-method","html_id":"zremrangebylex(key,min,max)-instance-method","name":"zremrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command removes all\nelements in the sorted set stored at key between the lexicographical range\nspecified by min and max.\n\n**Return value**: Integer, the number of elements removed.","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1314","def":{"name":"zremrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYLEX\", key.to_s, min.to_s, max.to_s])"}},{"id":"zremrangebyrank(key,start,stop)-instance-method","html_id":"zremrangebyrank(key,start,stop)-instance-method","name":"zremrangebyrank","doc":"Removes all elements in the sorted set stored at key with rank between start and stop.\n\n**Return value**: Integer, the number of elements removed.","summary":"

    Removes all elements in the sorted set stored at key with rank between start and stop.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1321","def":{"name":"zremrangebyrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYRANK\", key.to_s, start.to_s, stop.to_s])"}},{"id":"zremrangebyscore(key,start,stop)-instance-method","html_id":"zremrangebyscore(key,start,stop)-instance-method","name":"zremrangebyscore","doc":"Removes all elements in the sorted set stored at key with a score\nbetween min and max (inclusive).\n\n**Return value**: Integer, the number of elements removed.","summary":"

    Removes all elements in the sorted set stored at key with a score between min and max (inclusive).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1329","def":{"name":"zremrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYSCORE\", key.to_s, start.to_s, stop.to_s])"}},{"id":"zrevrange(key,start,stop,with_scores=false)-instance-method","html_id":"zrevrange(key,start,stop,with_scores=false)-instance-method","name":"zrevrange","doc":"Returns the specified range of elements in the sorted set stored at key.\n\n**Options**:\n\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified range (optionally with their scores, in case the with_scores option is true).","summary":"

    Returns the specified range of elements in the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, start, stop, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1262","def":{"name":"zrevrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGE\", key.to_s, start.to_s, stop.to_s]\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrevrangebylex(key,min,max,limit=nil)-instance-method","html_id":"zrevrangebylex(key,min,max,limit=nil)-instance-method","name":"zrevrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command returns all the\nelements in the sorted set at key with a value between min and max.\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n\n**Return value**:","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"args_string":"(key, min, max, limit = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1280","def":{"name":"zrevrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGEBYLEX\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nstring_array_command(q)\n"}},{"id":"zrevrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","html_id":"zrevrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","name":"zrevrangebyscore","doc":"Returns all the elements in the sorted set at key with a score between\nmax and min (including elements with score equal to max or min).\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified score range (optionally with their scores).","summary":"

    Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, min, max, limit = nil, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1297","def":{"name":"zrevrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGEBYSCORE\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrevrank(key,member)-instance-method","html_id":"zrevrank(key,member)-instance-method","name":"zrevrank","doc":"Returns the rank of member in the sorted set stored at key,\nwith the scores ordered from high to low.\n\n**Return value**:\n* If member exists in the sorted set, Integer: the rank of member.\n* If member does not exist in the sorted set or key does not exist: nil.","summary":"

    Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1165","def":{"name":"zrevrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"ZREVRANK\", key.to_s, member.to_s])"}},{"id":"zscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"zscan(key,cursor,match=nil,count=nil)-instance-method","name":"zscan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array(String), contains two elements, a member and its associated score, for every returned element of the sorted set.\n\nExample:\n\n```\nredis.zscan(\"myzset\", 0)\nredis.zscan(\"myzset\", 0, \"foo*\")\nredis.zscan(\"myzset\", 0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1349","def":{"name":"zscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"zscore(key,member)-instance-method","html_id":"zscore(key,member)-instance-method","name":"zscore","doc":"Returns the score of member in the sorted set at key.\n\n**Return value**: String, the score of member (a double precision floating point number).","summary":"

    Returns the score of member in the sorted set at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1118","def":{"name":"zscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"ZSCORE\", key.to_s, member.to_s])"}},{"id":"zunionstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","html_id":"zunionstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","name":"zunionstore","doc":"Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.\n\n**Options**:\n\n* weights - nil or Array(String): Using the WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set.\n* aggregate - With the AGGREGATE option, it is possible to specify how the results of the union are aggregated.\n\n**Return value**: Integer, the number of elements in the resulting sorted set at destination.","summary":"

    Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"args_string":"(destination, keys : Array, weights = nil, aggregate = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/commands.cr#L1205","def":{"name":"zunionstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"numkeys = keys.size\nq = concat([\"ZUNIONSTORE\", destination.to_s, numkeys.to_s], keys)\nif weights\n q << \"WEIGHTS\"\n concat(q, weights)\nend\nif aggregate\n (q << \"AGGREGATE\") << aggregate.to_s\nend\ninteger_command(q)\n"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandTimeoutError","path":"Redis/CommandTimeoutError.html","kind":"class","full_name":"Redis::CommandTimeoutError","name":"CommandTimeoutError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":18,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when the `command_timeout` option triggers - a command took too long because the Redis-server is blocked by another command or by a dump.","summary":"

    Raised when the command_timeout option triggers - a command took too long because the Redis-server is blocked by another command or by a dump.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","path":"Redis/ConnectionError.html","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":6,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CannotConnectError","kind":"class","full_name":"Redis::CannotConnectError","name":"CannotConnectError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionLostError","kind":"class","full_name":"Redis::ConnectionLostError","name":"ConnectionLostError"}],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"An error that makes the connection unusable.","summary":"

    An error that makes the connection unusable.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionLostError","path":"Redis/ConnectionLostError.html","kind":"class","full_name":"Redis::ConnectionLostError","name":"ConnectionLostError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":14,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when the connection to the Redis server is lost.","summary":"

    Raised when the connection to the Redis server is lost.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","path":"Redis/Error.html","kind":"class","full_name":"Redis::Error","name":"Error","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":2,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandTimeoutError","kind":"class","full_name":"Redis::CommandTimeoutError","name":"CommandTimeoutError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PoolTimeoutError","kind":"class","full_name":"Redis::PoolTimeoutError","name":"PoolTimeoutError"}],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Exception for errors raised by this shard.","summary":"

    Exception for errors raised by this shard.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Future","path":"Redis/Future.html","kind":"class","full_name":"Redis::Future","name":"Future","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/future.cr","line_number":6,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/future.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Futures are handles for values that will become available at a later point in time.\n\nThe API methods Redis#pipelined and Redis#multi make commands return futures instead of actual values.\n\nSee this [example](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/pipelining.cr).","summary":"

    Futures are handles for values that will become available at a later point in time.

    ","class_methods":[],"constructors":[{"id":"new-class-method","html_id":"new-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/future.cr#L9","def":{"name":"new","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"value-instance-method","html_id":"value-instance-method","name":"value","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/future.cr#L14","def":{"name":"value","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if @ready\n @value\nelse\n raise(Redis::Error.new(\"Future value not ready yet\"))\nend"}},{"id":"value=(new_value)-instance-method","html_id":"value=(new_value)-instance-method","name":"value=","doc":null,"summary":null,"abstract":false,"args":[{"name":"new_value","doc":null,"default_value":"","external_name":"new_value","restriction":""}],"args_string":"(new_value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/future.cr#L22","def":{"name":"value=","args":[{"name":"new_value","doc":null,"default_value":"","external_name":"new_value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@value = new_value\n@ready = true\n"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PipelineApi","path":"Redis/PipelineApi.html","kind":"class","full_name":"Redis::PipelineApi","name":"PipelineApi","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/pipeline_api.cr","line_number":18,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pipeline_api.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"API for sending commands in pipelined mode.\n\nUsed in Redis#pipelined.\n\nExample:\n\n```\nredis.pipelined do |pipeline|\n pipeline.set(\"foo1\", \"first\")\n pipeline.set(\"foo2\", \"second\")\nend\n```\n\nIn this example, the `pipeline` object passed to the block is a PipelineApi\nobject.","summary":"

    API for sending commands in pipelined mode.

    ","class_methods":[],"constructors":[{"id":"new(strategy)-class-method","html_id":"new(strategy)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"args_string":"(strategy)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pipeline_api.cr#L21","def":{"name":"new","args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(strategy)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PooledClient","path":"Redis/PooledClient.html","kind":"class","full_name":"Redis::PooledClient","name":"PooledClient","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/pooled_client.cr","line_number":20,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"A Redis client object that can be shared across multiple fibers.\nIt is backed by a connection pool of `Redis` instances and will automatically allocate and free these instances from/to the pool, per command.\n\nExample usage:\n\n```Crystal\nredis = Redis::PooledClient.new(host: ..., port: ..., ..., pool_size: 5)\n10.times do |i|\n spawn do\n redis.set(\"foo#{i}\", \"bar\")\n redis.get(\"foo#{i}\") # => \"bar\"\n end\nend\n```\n\nHere 10 fibers access the same `Redis::PooledClient` instance while automatically sharing 5 Redis connections.\n","summary":"

    A Redis client object that can be shared across multiple fibers.

    ","class_methods":[],"constructors":[{"id":"new(*args,pool_size=5,pool_timeout=5.0,**args2)-class-method","html_id":"new(*args,pool_size=5,pool_timeout=5.0,**args2)-class-method","name":"new","doc":"Accepts the same connection parameters like a `Redis` instance, plus the documented ones.\n\n* pool_size - the number of `Redis` to hold in the connection pool.\n* pool_timeout - the time to wait for a `Redis` instance to become available from the pool before dying with `Redis::PoolTimeoutError`.","summary":"

    Accepts the same connection parameters like a Redis instance, plus the documented ones.

    ","abstract":false,"args":[{"name":"args","doc":null,"default_value":"","external_name":"args","restriction":""},{"name":"pool_size","doc":null,"default_value":"5","external_name":"pool_size","restriction":""},{"name":"pool_timeout","doc":null,"default_value":"5.0","external_name":"pool_timeout","restriction":""}],"args_string":"(*args, pool_size = 5, pool_timeout = 5.0, **args2)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr#L29","def":{"name":"new","args":[{"name":"args","doc":null,"default_value":"","external_name":"args","restriction":""},{"name":"pool_size","doc":null,"default_value":"5","external_name":"pool_size","restriction":""},{"name":"pool_timeout","doc":null,"default_value":"5.0","external_name":"pool_timeout","restriction":""}],"double_splat":{"name":"args2","doc":null,"default_value":"","external_name":"args2","restriction":""},"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(*args, **args2, pool_size: pool_size, pool_timeout: pool_timeout)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"pool:ConnectionPool(Redis)-instance-method","html_id":"pool:ConnectionPool(Redis)-instance-method","name":"pool","doc":"The connection pool.\nSee [https://github.com/ysbaddaden/pool](https://github.com/ysbaddaden/pool)","summary":"

    The connection pool.

    ","abstract":false,"args":[],"args_string":" : ConnectionPool(Redis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr#L23","def":{"name":"pool","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@pool"}},{"id":"psubscribe(*channel_patterns,&callback_setup_block:Redis::Subscription->)-instance-method","html_id":"psubscribe(*channel_patterns,&callback_setup_block:Redis::Subscription->)-instance-method","name":"psubscribe","doc":null,"summary":null,"abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns, &callback_setup_block : Redis::Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr#L59","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Redis::Subscription -> )"},"return_type":"","visibility":"Public","body":"with_pool_connection(&.psubscribe(*channel_patterns) do |s|\n callback_setup_block.call(s)\nend)"}},{"id":"subscribe(*channels,&callback_setup_block:Redis::Subscription->)-instance-method","html_id":"subscribe(*channels,&callback_setup_block:Redis::Subscription->)-instance-method","name":"subscribe","doc":null,"summary":null,"abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels, &callback_setup_block : Redis::Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr#L55","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Redis::Subscription -> )"},"return_type":"","visibility":"Public","body":"with_pool_connection(&.subscribe(*channels) do |s|\n callback_setup_block.call(s)\nend)"}}],"macros":[{"id":"method_missing(call)-macro","html_id":"method_missing(call)-macro","name":"method_missing","doc":null,"summary":null,"abstract":false,"args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"args_string":"(call)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/pooled_client.cr#L35","def":{"name":"method_missing","args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"double_splat":null,"splat_index":null,"block_arg":null,"visibility":"Public","body":" \n# Delegates all Redis commands to a `Redis` instance from the connection pool.\n\n with_pool_connection \n{ |conn| conn.\n{{ call }}\n }\n \n"}}],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PoolTimeoutError","path":"Redis/PoolTimeoutError.html","kind":"class","full_name":"Redis::PoolTimeoutError","name":"PoolTimeoutError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":22,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when no free connection became available in the pool within a certain time.","summary":"

    Raised when no free connection became available in the pool within a certain time.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/SocketWrapper","path":"Redis/SocketWrapper.html","kind":"struct","full_name":"Redis::SocketWrapper","name":"SocketWrapper","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"github.com/stefanwille/crystal-redis/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/socket_wrapper.cr","line_number":4,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/socket_wrapper.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Wraps an open socket connection.\n\nThe purpose is to be able to convert all exceptions to Redis:Error's.","summary":"

    Wraps an open socket connection.

    ","class_methods":[],"constructors":[{"id":"new(socket:TCPSocket|UNIXSocket|OpenSSL::SSL::Socket::Client)-class-method","html_id":"new(socket:TCPSocket|UNIXSocket|OpenSSL::SSL::Socket::Client)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"socket","doc":null,"default_value":"","external_name":"socket","restriction":"TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client"}],"args_string":"(socket : TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/socket_wrapper.cr#L5","def":{"name":"new","args":[{"name":"socket","doc":null,"default_value":"","external_name":"socket","restriction":"TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(socket)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"id":"new(&block)-class-method","html_id":"new(&block)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/socket_wrapper.cr#L9","def":{"name":"new","args":[],"double_splat":null,"splat_index":null,"yields":0,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n self.new(yield)\nrescue ex : IO::Timeout | Errno | Socket::Error | OpenSSL::Error\n raise(Redis::CannotConnectError.new(\"#{ex.class}: #{ex.message}\"))\nend"}}],"instance_methods":[{"id":"close-instance-method","html_id":"close-instance-method","name":"close","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/socket_wrapper.cr#L27","def":{"name":"close","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n if @connected\n @connected = false\n @socket.close\n end\nrescue Errno\nend"}}],"macros":[{"id":"method_missing(call)-macro","html_id":"method_missing(call)-macro","name":"method_missing","doc":null,"summary":null,"abstract":false,"args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"args_string":"(call)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/socket_wrapper.cr#L15","def":{"name":"method_missing","args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"double_splat":null,"splat_index":null,"block_arg":null,"visibility":"Public","body":" catch_errors \n{ @socket.\n{{ call }}\n }\n \n"}}],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Subscription","path":"Redis/Subscription.html","kind":"class","full_name":"Redis::Subscription","name":"Subscription","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/subscription.cr","line_number":5,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Models a subscription to one or more publish/subscribe channels.\n\nThe caller sets callbacks on this object that the Redis client will\ntrigger for the matching events.","summary":"

    Models a subscription to one or more publish/subscribe channels.

    ","class_methods":[],"constructors":[],"instance_methods":[{"id":"message(&message_callback:String,String->)-instance-method","html_id":"message(&message_callback:String,String->)-instance-method","name":"message","doc":"Sets the 'message' callback.","summary":"

    Sets the 'message' callback.

    ","abstract":false,"args":[],"args_string":"(&message_callback : String, String -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L28","def":{"name":"message","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"message_callback","doc":null,"default_value":"","external_name":"message_callback","restriction":"(String, String -> )"},"return_type":"","visibility":"Public","body":"@message_callback = message_callback"}},{"id":"pmessage(&pmessage_callback:String,String,String->)-instance-method","html_id":"pmessage(&pmessage_callback:String,String,String->)-instance-method","name":"pmessage","doc":"Sets the 'pmessage' callback.","summary":"

    Sets the 'pmessage' callback.

    ","abstract":false,"args":[],"args_string":"(&pmessage_callback : String, String, String -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L32","def":{"name":"pmessage","args":[],"double_splat":null,"splat_index":null,"yields":3,"block_arg":{"name":"pmessage_callback","doc":null,"default_value":"","external_name":"pmessage_callback","restriction":"(String, String, String -> )"},"return_type":"","visibility":"Public","body":"@pmessage_callback = pmessage_callback"}},{"id":"psubscribe(&psubscribe_callback:String,Int64->)-instance-method","html_id":"psubscribe(&psubscribe_callback:String,Int64->)-instance-method","name":"psubscribe","doc":"Sets the 'psubscribe' callback.","summary":"

    Sets the 'psubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&psubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L24","def":{"name":"psubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"psubscribe_callback","doc":null,"default_value":"","external_name":"psubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@psubscribe_callback = psubscribe_callback"}},{"id":"punsubscribe(&punsubscribe_callback:String,Int64->)-instance-method","html_id":"punsubscribe(&punsubscribe_callback:String,Int64->)-instance-method","name":"punsubscribe","doc":"Sets the 'punsubscribe' callback.","summary":"

    Sets the 'punsubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&punsubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L40","def":{"name":"punsubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"punsubscribe_callback","doc":null,"default_value":"","external_name":"punsubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@punsubscribe_callback = punsubscribe_callback"}},{"id":"subscribe(&subscribe_callback:String,Int64->)-instance-method","html_id":"subscribe(&subscribe_callback:String,Int64->)-instance-method","name":"subscribe","doc":"Sets the 'subscribe' callback.","summary":"

    Sets the 'subscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&subscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L20","def":{"name":"subscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"subscribe_callback","doc":null,"default_value":"","external_name":"subscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@subscribe_callback = subscribe_callback"}},{"id":"unsubscribe(&unsubscribe_callback:String,Int64->)-instance-method","html_id":"unsubscribe(&unsubscribe_callback:String,Int64->)-instance-method","name":"unsubscribe","doc":"Sets the 'unsubscribe' callback.","summary":"

    Sets the 'unsubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&unsubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/subscription.cr#L36","def":{"name":"unsubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"unsubscribe_callback","doc":null,"default_value":"","external_name":"unsubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@unsubscribe_callback = unsubscribe_callback"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/TransactionApi","path":"Redis/TransactionApi.html","kind":"class","full_name":"Redis::TransactionApi","name":"TransactionApi","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/transaction_api.cr","line_number":19,"url":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/transaction_api.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"API for sending commands in a transaction.\n\nUsed in Redis#multi.\n\n\nExample:\n\n```\nredis.multi do |multi|\n multi.set(\"foo1\", \"first\")\n multi.set(\"foo2\", \"second\")\nend\n```\n\nIn this example, the `multi` object passed to the block is a TransactionApi\nobject.","summary":"

    API for sending commands in a transaction.

    ","class_methods":[],"constructors":[{"id":"new(strategy)-class-method","html_id":"new(strategy)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"args_string":"(strategy)","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/transaction_api.cr#L22","def":{"name":"new","args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(strategy)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"discard-instance-method","html_id":"discard-instance-method","name":"discard","doc":"Aborts the current transaction.\n\n**Example**:\n\n```\nredis.multi do |multi|\n multi.set(\"foo\", \"the new value\")\n multi.discard\nend\n```","summary":"

    Aborts the current transaction.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/d95a9867d324401754dfa10d4fa5745a85a2e740/src/redis/transaction_api.cr#L39","def":{"name":"discard","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@strategy.discard"}}],"macros":[],"types":[]}]}]}}) \ No newline at end of file +crystal_doc_search_index_callback({"repository_name":"github.com/stefanwille/crystal-redis","body":"# Redis Client for Crystal\n\n[![Build Status](https://img.shields.io/travis/stefanwille/crystal-redis/master.svg?style=flat)](https://travis-ci.org/stefanwille/crystal-redis) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests)\n\nA Redis client for the Crystal programming language.\n\n## Features\n\n- Performance (> 680,000 commands per second using pipeline on a MacBook Air with a single client thread)\n- Pipelining\n- Transactions\n- LUA Scripting\n- All string commands\n- All hash commands\n- All list commands\n- All set commands\n- All hyperloglog commands\n- All commands for bit operations\n- All sorted set commands\n- Publish/subscribe\n\n## Installation\n\nAdd it to your `shard.yml`:\n\n```crystal\ndependencies:\n redis:\n github: stefanwille/crystal-redis\n version: ~> 2.3.0\n```\n\nand then install the library into your project:\n\n```bash\n$ shards install\n```\n\n### Installation on MacOS X\n\nOn MacOS X you may get this error:\n\n```\nld: library not found for -lssl (this usually means you need to install the development package for libssl)\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\n...\n```\n\nOr this warning:\n\n```\nPackage libssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libssl.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'libssl' found\nPackage libcrypto was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libcrypto.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'libcrypto' found\n```\n\nThe problem is that Crystal can't find openssl, because it is not installed by default on MacOS X.\n\nThe fix:\n\n1. Install openssl via [Homebrew](https://brew.sh/):\n\n```bash\n$ brew install openssl\n```\n\n2. Set the environment variable `PKG_CONFIG_PATH`:\n\n```bash\n$ export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig\n```\n\nNote: Please write me if you know a better way!\n\n## Required Crystal Version\n\nThis library needs Crystal version >= 0.25.0\n\nI haven't tested older Crystal versions.\n\n## Usage\n\nRequire the package:\n\n```crystal\n require \"redis\"\n```\n\nthen\n\n```crystal\n redis = Redis.new\n```\n\nThen you can call Redis commands on the `redis` object:\n\n```crystal\n redis.set(\"foo\", \"bar\")\n redis.get(\"foo\")\n```\n\n#### Connection Pooling\n\nSince version 2.0.0, a connection pool is built in. It is used implicitly through `Redis::PooledClient`:\n\n```Crystal\nredis = Redis::PooledClient.new\n10.times do |i|\n spawn do\n redis.set(\"foo#{i}\", \"bar\")\n redis.get(\"foo#{i}\") # => \"bar\"\n end\nend\n```\n\nThis `redis` instance can be shared across fibers, and accepts the same Redis commands as the `Redis` class.\nIt automatically allocates and frees connections from/to the pool, per command.\n\n## Examples\n\nTo get started, see the examples:\n\n- There is a separate git repository [crystal-redis-examples](https://github.com/stefanwille/crystal-redis-examples) with examples.\n- start with this [basic example](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/basic.cr)\n- look at [the other examples](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/)\n- the [spec](https://github.com/stefanwille/crystal-redis/blob/master/spec/redis_spec.cr) contains even more usage examples\n\n## Documentation\n\n- [API documentation](http://stefanwille.github.io/crystal-redis) -\n start reading it at the class `Redis`.\n- [Redis commands documentation](http://redis.io/commands) - the original Redis documentation is necessary, as the API documentation above is just a quick reference\n- [Redis documentation page](http://redis.io/documentation) - general information about Redis and its concepts\n\n## Performance\n\nI have benchmarked Crystal-Redis against several other client libraries in various programming languages in this [blog article](http://www.stefanwille.com/2015/05/redis-clients-crystal-vs-ruby-vs-c-vs-go/).\n\nHere are some results:\n\n- Crystal: With this library I get > 680,000 commands per second using pipeline on a MacBook Air with a single client thread.\n\n- C: The equivalent program written in C with Hiredis gets me 340,000 commands per second.\n\n- Ruby: Ruby 2.2.1 with the [redis-rb](https://github.com/redis/redis-rb) and Hiredis driver handles 150,000 commands per second.\n\n[Read more results](http://www.stefanwille.com/2015/05/redis-clients-crystal-vs-ruby-vs-c-vs-go/) for Go, Java, Node.js.\n\n## Status\n\nI have exercised every API method in the spec and built some example programs. Some people report production usage.\n\nI took great care to make this library very usable with respect to API, reliability and documentation.\n\n## Development\n\nThis project requires a locally running redis server running on port 6379 and with a Unix socket located at /tmp/redis.sock. In Homebrew's default redis.config the Unix domain socket option is disabled. To enable, edit `/usr/local/etc/redis.conf` or whatever your `redis.conf` is and uncomment this line:\n\n```\n# unixsocket /tmp/redis.sock\n```\n\nso that it reads\n\n```\nunixsocket /tmp/redis.sock\n```\n\nThen you can run the specs via\n\n`$ crystal spec`\n\n[See more information](https://github.com/stefanwille/crystal-redis/blob/master/CONTRIBUTING.md).\n\n### WARNING\n\nRunning the spec will delete database number 0!\n\n## Questions, Bugs & Support\n\nIf you have questions or need help, please open a ticket in the [GitHub issue tracker](https://github.com/stefanwille/crystal-redis/issues). This way others can benefit from the discussion.\n","program":{"html_id":"github.com/stefanwille/crystal-redis/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"superclass":null,"ancestors":[],"locations":[],"repository_name":"github.com/stefanwille/crystal-redis","program":true,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":null,"doc":null,"summary":null,"class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis","path":"Redis.html","kind":"class","full_name":"Redis","name":"Redis","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/ValueOriented","kind":"module","full_name":"Redis::CommandExecution::ValueOriented","name":"ValueOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/commands.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr"},{"filename":"redis/command_execution/value_oriented.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/command_execution/value_oriented.cr"},{"filename":"redis.cr","line_number":37,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr"},{"filename":"redis/command_execution/future_oriented.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/command_execution/future_oriented.cr"},{"filename":"redis/strategy/base.cr","line_number":1,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/strategy/base.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/ValueOriented","kind":"module","full_name":"Redis::CommandExecution::ValueOriented","name":"ValueOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":null,"doc":"The class is the main entry point for the Redis client.\n\n**How to use**:\n\nRequire the package:\n\n```crystal\nrequire \"redis\"\n```\n\nThen instantiate this client class:\n\n```crystal\nredis = Redis.new\n```\n\nThen you can call Redis commands on the `redis` object:\n\n```crystal\nredis.set(\"foo\", \"bar\")\nredis.get(\"foo\")\nredis.incr(\"visitors\")\n```\n\nSee the mixin module [Commands](Redis/Commands.html) for most\nof the available Redis commands such as #incr, #rename, and so on.\n\n**Multithreading / Coroutines**\n\nPlease mind that a Redis object can't be shared across multiple threads/coroutines!\nEach thread/coroutine that wants to talk to Redis needs its own Redis object instance.","summary":"

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

    ","class_methods":[{"id":"open(host="localhost",port=6379,unixsocket=nil,password=nil,database=nil,url=nil,ssl=false,ssl_context=nil,dns_timeout=nil,connect_timeout=nil,reconnect=true,command_timeout=nil,&block)-class-method","html_id":"open(host=&quot;localhost&quot;,port=6379,unixsocket=nil,password=nil,database=nil,url=nil,ssl=false,ssl_context=nil,dns_timeout=nil,connect_timeout=nil,reconnect=true,command_timeout=nil,&block)-class-method","name":"open","doc":"Opens a Redis connection, yields the given block with a Redis object and closes the connection.\n\n**Options**:\n* host - the host to connect to\n* port - the port to connect to\n* unixsocket - instead of using TCP, you can connect to Redis via a Unix domain socket by passing its path here (e.g. \"/tmp/redis.sock\")\n* password - the password for authentication against the server. This is a convenience which saves you the extra call to the Redis `auth` command.\n* database - the number of the database to select. This a convenience which saves you a call a call to `#select`.\n* ssl - whether SSL should be enabled.\n* ssl_context - a OpenSSL::SSL::Context::Client.\n* dns_timeout - the dns timeout.\n* connect_timeout - the connect timeout.\n* command_timeout - the command timeout - applies when a command takes too long because the Redis-server is blocked by another command or by a dump.\n* reconnect - whether we should reconnect when we encounter a disconnected Redis connection.\n* url - Redis url. If this is given, it overrides all others.\n\nExample:\n\n```\nRedis.open do |redis|\n redis.incr(\"counter\")\nend\n```","summary":"

    Opens a Redis connection, yields the given block with a Redis object and closes the connection.

    ","abstract":false,"args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":""},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":""},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":""},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":""},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":""},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":""},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":""}],"args_string":"(host = "localhost", port = 6379, unixsocket = nil, password = nil, database = nil, url = nil, ssl = false, ssl_context = nil, dns_timeout = nil, connect_timeout = nil, reconnect = true, command_timeout = nil, &block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L193","def":{"name":"open","args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":""},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":""},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":""},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":""},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":""},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":""},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":""}],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"redis = Redis.new(host, port, unixsocket, password, database, url, ssl, ssl_context, dns_timeout, connect_timeout, reconnect, command_timeout)\nbegin\n yield redis\nensure\n redis.close\nend\n"}}],"constructors":[{"id":"new(host="localhost",port=6379,unixsocket:String?=nil,password:String?=nil,database:Int32?=nil,url=nil,ssl=false,ssl_context:OpenSSL::SSL::Context::Client?=nil,dns_timeout:Time::Span?=nil,connect_timeout:Time::Span?=nil,reconnect=true,command_timeout:Time::Span?=nil)-class-method","html_id":"new(host=&quot;localhost&quot;,port=6379,unixsocket:String?=nil,password:String?=nil,database:Int32?=nil,url=nil,ssl=false,ssl_context:OpenSSL::SSL::Context::Client?=nil,dns_timeout:Time::Span?=nil,connect_timeout:Time::Span?=nil,reconnect=true,command_timeout:Time::Span?=nil)-class-method","name":"new","doc":"Opens a Redis connection\n\n**Options**:\n* host - the host to connect to\n* port - the port to connect to\n* unixsocket - instead of using TCP, you can connect to Redis via a Unix domain socket by passing its path here (e.g. \"/tmp/redis.sock\")\n* password - the password for authentication against the server. This is a convenience which saves you the extra call to the Redis `auth` command.\n* database - the number of the database to select. This a convenience which saves you a call a call to `#select`.\n* ssl - whether SSL should be enabled.\n* ssl_context - a OpenSSL::SSL::Context::Client.\n* dns_timeout - the dns timeout.\n* connect_timeout - the connect timeout.\n* command_timeout - the command timeout - applies when a command takes too long because the Redis-server is blocked by another command or by a dump.\n* reconnect - whether we should reconnect when we encounter a disconnected Redis connection.\n* url - Redis url. If this is given, it overrides all others.\n\nExample:\n\n```\nredis = Redis.new\nredis.incr(\"counter\")\nredis.close\n```\n\nExample:\n\n```\nredis = Redis.new(host: \"localhost\", port: 6379)\n...\n```\n\nExample:\n\n```\nredis = Redis.new(unixsocket: \"/tmp/redis.sock\")\n...\n```\n\nExample:\n\n```\nredis = Redis.new(url: \"redis://:my-secret-pw@my.redis.com:6380/my-database\")\n...\n```","summary":"

    Opens a Redis connection

    ","abstract":false,"args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":"String | ::Nil"},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":"Int32 | ::Nil"},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":"OpenSSL::SSL::Context::Client | ::Nil"},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":"Time::Span | ::Nil"},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":"Time::Span | ::Nil"},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":"Time::Span | ::Nil"}],"args_string":"(host = "localhost", port = 6379, unixsocket : String? = nil, password : String? = nil, database : Int32? = nil, url = nil, ssl = false, ssl_context : OpenSSL::SSL::Context::Client? = nil, dns_timeout : Time::Span? = nil, connect_timeout : Time::Span? = nil, reconnect = true, command_timeout : Time::Span? = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L95","def":{"name":"new","args":[{"name":"host","doc":null,"default_value":"\"localhost\"","external_name":"host","restriction":""},{"name":"port","doc":null,"default_value":"6379","external_name":"port","restriction":""},{"name":"unixsocket","doc":null,"default_value":"nil","external_name":"unixsocket","restriction":"String | ::Nil"},{"name":"password","doc":null,"default_value":"nil","external_name":"password","restriction":"String | ::Nil"},{"name":"database","doc":null,"default_value":"nil","external_name":"database","restriction":"Int32 | ::Nil"},{"name":"url","doc":null,"default_value":"nil","external_name":"url","restriction":""},{"name":"ssl","doc":null,"default_value":"false","external_name":"ssl","restriction":""},{"name":"ssl_context","doc":null,"default_value":"nil","external_name":"ssl_context","restriction":"OpenSSL::SSL::Context::Client | ::Nil"},{"name":"dns_timeout","doc":null,"default_value":"nil","external_name":"dns_timeout","restriction":"Time::Span | ::Nil"},{"name":"connect_timeout","doc":null,"default_value":"nil","external_name":"connect_timeout","restriction":"Time::Span | ::Nil"},{"name":"reconnect","doc":null,"default_value":"true","external_name":"reconnect","restriction":""},{"name":"command_timeout","doc":null,"default_value":"nil","external_name":"command_timeout","restriction":"Time::Span | ::Nil"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(host, port, unixsocket, password, database, url, ssl, ssl_context, dns_timeout, connect_timeout, reconnect, command_timeout)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"close-instance-method","html_id":"close-instance-method","name":"close","doc":"Closes the Redis connection.","summary":"

    Closes the Redis connection.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L205","def":{"name":"close","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@connection.try(&.close)\n@connection = nil\n@strategy = nil\n"}},{"id":"multi(&block)-instance-method","html_id":"multi(&block)-instance-method","name":"multi","doc":"Sends Redis commands in transaction mode.\n\nYields its block. The block receives as argument\nan object that has the same API as this class, except:\n * it participates in the transaction\n * all the Redis commands return Futures\n * there is an additional method #discard that will abort the transaction.\n\n**Return value**: an array with all the responses\n- one element for each executed command.\n\nExample:\n\n```\nredis.multi do |multi|\n multi.set(\"foo1\", \"first\")\n multi.set(\"foo2\", \"second\")\nend\n```\n\nSee the [examples repository](https://github.com/stefanwille/crystal-redis-examples) for more examples.","summary":"

    Sends Redis commands in transaction mode.

    ","abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L284","def":{"name":"multi","args":[],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n @strategy = Redis::Strategy::PauseDuringTransaction.new\n transaction_strategy = Redis::Strategy::Transaction.new(connection)\n transaction_strategy.begin\n transaction_api = Redis::TransactionApi.new(transaction_strategy)\n yield transaction_api\n transaction_strategy.commit.as(Array(RedisValue))\nrescue ex : Redis::ConnectionError | Redis::CommandTimeoutError\n close\n raise(ex)\nensure\n if @connection\n @strategy = Redis::Strategy::SingleStatement.new(@connection.not_nil!)\n end\nend"}},{"id":"pipelined(&block)-instance-method","html_id":"pipelined(&block)-instance-method","name":"pipelined","doc":"Sends Redis commands in pipeline mode.\n\nYields its block. The block receives as argument\nan object that has the same API as this class, except\nit participates in pipelining and all Redis commands return Futures.\n\n**Return value**: an array with all the responses\n- one element for each executed command.\n\nExample:\n\n```\nredis.pipelined do |pipeline|\n pipeline.set(\"foo1\", \"first\")\n pipeline.set(\"foo2\", \"second\")\nend\n```\n\nSee the [examples repository](https://github.com/stefanwille/crystal-redis-examples) for more examples.","summary":"

    Sends Redis commands in pipeline mode.

    ","abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L248","def":{"name":"pipelined","args":[],"double_splat":null,"splat_index":null,"yields":1,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n @strategy = Redis::Strategy::PauseDuringPipeline.new\n pipeline_strategy = Redis::Strategy::Pipeline.new(connection)\n pipeline_api = Redis::PipelineApi.new(pipeline_strategy)\n yield pipeline_api\n pipeline_strategy.commit.as(Array(RedisValue))\nrescue ex : Redis::ConnectionError | Redis::CommandTimeoutError\n close\n raise(ex)\nensure\n if @connection\n @strategy = Redis::Strategy::SingleStatement.new(@connection.not_nil!)\n end\nend"}},{"id":"url-instance-method","html_id":"url-instance-method","name":"url","doc":"Returns the server URL for this client.","summary":"

    Returns the server URL for this client.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis.cr#L212","def":{"name":"url","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"scheme = @ssl ? \"rediss\" : \"redis\"\nif @unixsocket\n \"#{scheme}://#{@unixsocket}/#{@database || 0}\"\nelse\n \"#{scheme}://#{@host}:#{@port}/#{@database || 0}\"\nend\n"}}],"macros":[],"types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CannotConnectError","path":"Redis/CannotConnectError.html","kind":"class","full_name":"Redis::CannotConnectError","name":"CannotConnectError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":10,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when connecting to the Redis server is not possible.","summary":"

    Raised when connecting to the Redis server is not possible.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","path":"Redis/Commands.html","kind":"module","full_name":"Redis::Commands","name":"Commands","abstract":false,"superclass":null,"ancestors":[],"locations":[{"filename":"redis/commands.cr","line_number":4,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PipelineApi","kind":"class","full_name":"Redis::PipelineApi","name":"PipelineApi"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/TransactionApi","kind":"class","full_name":"Redis::TransactionApi","name":"TransactionApi"}],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Definition of all Redis commands except pipelining and transactions.\n","summary":"

    Definition of all Redis commands except pipelining and transactions.

    ","class_methods":[],"constructors":[],"instance_methods":[{"id":"append(key,value)-instance-method","html_id":"append(key,value)-instance-method","name":"append","doc":"If key already exists and is a string, this command appends the value at the end of the string.\nIf key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.\n\n**Return value**: Integer, the length of the string after the append operation.\n\nExample:\n\n```\nredis.append(\"foo\", \" world\")\n```","summary":"

    If key already exists and is a string, this command appends the value at the end of the string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L366","def":{"name":"append","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"APPEND\", key.to_s, value.to_s])"}},{"id":"auth(password)-instance-method","html_id":"auth(password)-instance-method","name":"auth","doc":"Request for authentication in a password-protected Redis server.\n\n**Return value**: \"OK\"","summary":"

    Request for authentication in a password-protected Redis server.

    ","abstract":false,"args":[{"name":"password","doc":null,"default_value":"","external_name":"password","restriction":""}],"args_string":"(password)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L87","def":{"name":"auth","args":[{"name":"password","doc":null,"default_value":"","external_name":"password","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"AUTH\", password])"}},{"id":"bitcount(key,from=nil,to=nil)-instance-method","html_id":"bitcount(key,from=nil,to=nil)-instance-method","name":"bitcount","doc":"Count the number of set bits (population counting) in a string.\nBy default all the bytes contained in the string are examined.\n\n**Options**:\n\n* from / to - It is possible to specify the counting operation only in an interval passing the additional arguments from and to.\n\n**Return value** Integer, the number of bits set to 1.\n\nExample:\n\n```\nredis.bitcount(\"foo\", 0, 0)\n```","summary":"

    Count the number of set bits (population counting) in a string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"nil","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"args_string":"(key, from = nil, to = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L418","def":{"name":"bitcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"nil","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BITCOUNT\", key.to_s]\nif from\n if to\n q << from.to_s\n q << to.to_s\n else\n raise(Redis::Error.new(\"from specified, but not to\"))\n end\nend\ninteger_command(q)\n"}},{"id":"bitop(operation,key,*keys:String):Int64-instance-method","html_id":"bitop(operation,key,*keys:String):Int64-instance-method","name":"bitop","doc":"Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.\n\n**Return value**: Integer, the size of the string stored in the destination key, that is equal to the size of the longest input string.\n\nExample:\n\n```\nredis.bitop(\"and\", \"dest\", \"key1\", \"key2\")\n```","summary":"

    Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

    ","abstract":false,"args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(operation, key, *keys : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L445","def":{"name":"bitop","args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":2,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"bitop(operation, key, keys.to_a)"}},{"id":"bitop(operation,key,keys:Array(String)):Int64-instance-method","html_id":"bitop(operation,key,keys:Array(String)):Int64-instance-method","name":"bitop","doc":"Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.\n\n**Return value**: Integer, the size of the string stored in the destination key, that is equal to the size of the longest input string.\n\nExample:\n\n```\nredis.bitop(\"and\", \"dest\", \"key1\", \"key2\")\n```","summary":"

    Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

    ","abstract":false,"args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(operation, key, keys : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L440","def":{"name":"bitop","args":[{"name":"operation","doc":null,"default_value":"","external_name":"operation","restriction":""},{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"BITOP\", operation.to_s, key.to_s], keys))"}},{"id":"bitpos(key,bit,start=nil,to=nil)-instance-method","html_id":"bitpos(key,bit,start=nil,to=nil)-instance-method","name":"bitpos","doc":"Return the position of the first bit set to 1 or 0 in a string.\n\n**Options**:\n\n* start / to - By default, all the bytes contained in the string are examined. It is possible to look for bits only in a specified interval passing the additional arguments start and to (it is possible to just pass start, the operation will assume that the to is the last byte of the string.\n\n**Return value**: Integer, the command returns the position of the first bit set to 1 or 0 according to the request.\n\nExample:\n\n```\nredis.set(\"mykey\", \"0\")\nredis.bitpos(\"mykey\", 1) # => 2\n```","summary":"

    Return the position of the first bit set to 1 or 0 in a string.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"bit","doc":null,"default_value":"","external_name":"bit","restriction":""},{"name":"start","doc":null,"default_value":"nil","external_name":"start","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"args_string":"(key, bit, start = nil, to = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L483","def":{"name":"bitpos","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"bit","doc":null,"default_value":"","external_name":"bit","restriction":""},{"name":"start","doc":null,"default_value":"nil","external_name":"start","restriction":""},{"name":"to","doc":null,"default_value":"nil","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BITPOS\", key.to_s, bit.to_s] of RedisValue\nif start\n q << start.to_s\n if to\n q << to\n end\nend\ninteger_command(q)\n"}},{"id":"blpop(keys,timeout_in_seconds)-instance-method","html_id":"blpop(keys,timeout_in_seconds)-instance-method","name":"blpop","doc":"BLPOP is a blocking list pop primitive.\nIt is the blocking version of LPOP because it blocks the connection when there\nare no elements to pop from any of the given lists.\nAn element is popped from the head of the first list that is non-empty,\nwith the given keys being checked in the order that they are given.\n\nThe timeout_in_seconds argument is interpreted as an integer value specifying the maximum number of seconds to block\n\n**Return value**: Array, specifically:\n* An array of nils when no element could be popped and the timeout expired.\n* An array of two-element arrays with the first element being the name of the key where an element was popped and the second element being the value of the popped element.\n\nExample:\n\n```\nredis.blpop([\"myotherlist\", \"mylist\"], 1) # => [\"mylist\", \"hello\"]\n```","summary":"

    BLPOP is a blocking list pop primitive.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(keys, timeout_in_seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L897","def":{"name":"blpop","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = concat([\"BLPOP\"], keys)\nq << timeout_in_seconds.to_s\narray_or_nil_command(q)\n"}},{"id":"brpop(keys,timeout_in_seconds)-instance-method","html_id":"brpop(keys,timeout_in_seconds)-instance-method","name":"brpop","doc":"BRPOP is a blocking list pop primitive.\nIt is the blocking version of RPOP because it blocks the connection when there\nare no elements to pop from any of the given lists.\nAn element is popped from the tail of the first list that is non-empty,\nwith the given keys being checked in the order that they are given.\n\nThe timeout_in_seconds argument is interpreted as an integer value specifying the maximum\nnumber of seconds to block.\n\n**Return value**: Array, specifically:\n* An array of nils when no element could be popped and the timeout expired.\n* An array of two-element arrays with the first element being the name of the key where an element was popped and the second element being the value of the popped element.\n\nExample:\n\n```\nredis.brpop([\"myotherlist\", \"mylist\"], 1) # => [\"mylist\", \"world\"]\n```","summary":"

    BRPOP is a blocking list pop primitive.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(keys, timeout_in_seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L921","def":{"name":"brpop","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = concat([\"BRPOP\"], keys)\nq << timeout_in_seconds.to_s\narray_or_nil_command(q)\n"}},{"id":"brpoplpush(source,destination,timeout_in_seconds=nil)-instance-method","html_id":"brpoplpush(source,destination,timeout_in_seconds=nil)-instance-method","name":"brpoplpush","doc":"BRPOPLPUSH is the blocking variant of RPOPLPUSH.\nWhen source contains elements, this command behaves exactly like RPOPLPUSH.\n\n**Options**:\n\n* timeout_in_seconds - interpreted as an integer value specifying the maximum number of seconds to block\n\nSee RPOPLPUSH for more information.\n\n**Return value**: String, the element being popped from source and pushed to destination.\nIf timeout is reached, nil is returned.\n\nExample:\n\n```\nredis.brpoplpush(\"source\", \"destination\", 0)\n```","summary":"

    BRPOPLPUSH is the blocking variant of RPOPLPUSH.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"nil","external_name":"timeout_in_seconds","restriction":""}],"args_string":"(source, destination, timeout_in_seconds = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L952","def":{"name":"brpoplpush","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"timeout_in_seconds","doc":null,"default_value":"nil","external_name":"timeout_in_seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"BRPOPLPUSH\", source.to_s, destination.to_s]\nif timeout_in_seconds\n q << timeout_in_seconds.to_s\nend\nstring_or_nil_command(q)\n"}},{"id":"decr(key)-instance-method","html_id":"decr(key)-instance-method","name":"decr","doc":"Decrements the number stored at key by one.\n\n**Return value**: Integer, the value of key after the decrement","summary":"

    Decrements the number stored at key by one.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L319","def":{"name":"decr","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"DECR\", key.to_s])"}},{"id":"decrby(key,decrement)-instance-method","html_id":"decrby(key,decrement)-instance-method","name":"decrby","doc":"Decrements the number stored at key by decrement.\n\n**Return value**: Integer, the value of key after the decrement","summary":"

    Decrements the number stored at key by decrement.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"decrement","doc":null,"default_value":"","external_name":"decrement","restriction":""}],"args_string":"(key, decrement)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L352","def":{"name":"decrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"decrement","doc":null,"default_value":"","external_name":"decrement","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"DECRBY\", key.to_s, decrement.to_s])"}},{"id":"del(keys:Array)-instance-method","html_id":"del(keys:Array)-instance-method","name":"del","doc":"Removes the specified keys.\n\n**Return value**: Integer, the number of keys that were removed.\n\nExample:\n\n```\nredis.del([\"some\", \"keys\", \"to\", \"delete\"])\n```","summary":"

    Removes the specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"args_string":"(keys : Array)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L146","def":{"name":"del","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"DEL\"], keys))"}},{"id":"del(*keys)-instance-method","html_id":"del(*keys)-instance-method","name":"del","doc":"Removes the specified keys.\n\n**Return value**: Integer, the number of keys that were removed.\n\nExample:\n\n```\nredis.del(\"some\", \"keys\", \"to\", \"delete\")\n```","summary":"

    Removes the specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L133","def":{"name":"del","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"del(keys.to_a)"}},{"id":"dump(key)-instance-method","html_id":"dump(key)-instance-method","name":"dump","doc":"Serialize the value stored at key in a Redis-specific format and return it to the user.\n\n**Return value**: String, the serialized value.","summary":"

    Serialize the value stored at key in a Redis-specific format and return it to the user.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L497","def":{"name":"dump","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"DUMP\", key.to_s])"}},{"id":"echo(message)-instance-method","html_id":"echo(message)-instance-method","name":"echo","doc":"Returns the given message.\n\nExample:\n\n```\nredis.echo(\"Hello Redis\") # => \"Hello Redis\"\n```","summary":"

    Returns the given message.

    ","abstract":false,"args":[{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"args_string":"(message)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L12","def":{"name":"echo","args":[{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"ECHO\", message.to_s])"}},{"id":"eval(script:String,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","html_id":"eval(script:String,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","name":"eval","doc":"EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter\nbuilt into Redis starting from version 2.6.0.\n\n**Return value**: Array(String), depends on the executed script\n\nExample:\n\n```\nredis.eval(\"return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}\", [\"key1\", \"key2\"], [\"first art\", \"second arg\"])\n```","summary":"

    EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.

    ","abstract":false,"args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"args_string":"(script : String, keys = [] of RedisValue, args = [] of RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1457","def":{"name":"eval","args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"EVAL\", script, keys.size.to_s], keys, args))"}},{"id":"evalsha(sha1,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","html_id":"evalsha(sha1,keys=[]ofRedisValue,args=[]ofRedisValue)-instance-method","name":"evalsha","doc":"EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter\nbuilt into Redis starting from version 2.6.0.\n\n**Return value**: Array(String), depends on the executed script","summary":"

    EVAL and EVALSHA are used to evaluate scripts using the Lua interpreter built into Redis starting from version 2.6.0.

    ","abstract":false,"args":[{"name":"sha1","doc":null,"default_value":"","external_name":"sha1","restriction":""},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"args_string":"(sha1, keys = [] of RedisValue, args = [] of RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1465","def":{"name":"evalsha","args":[{"name":"sha1","doc":null,"default_value":"","external_name":"sha1","restriction":""},{"name":"keys","doc":null,"default_value":"[] of RedisValue","external_name":"keys","restriction":""},{"name":"args","doc":null,"default_value":"[] of RedisValue","external_name":"args","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"EVALSHA\", sha1.to_s, keys.size.to_s], keys, args))"}},{"id":"exists(key)-instance-method","html_id":"exists(key)-instance-method","name":"exists","doc":"Returns if key exists.\n\n**Return value**:\n* 1 if the key exists.\n* 0 if the key does not exist.","summary":"

    Returns if key exists.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L545","def":{"name":"exists","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXISTS\", key.to_s])"}},{"id":"expire(key,seconds)-instance-method","html_id":"expire(key,seconds)-instance-method","name":"expire","doc":"Set a timeout on key.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.\n\nExample:\n\n```\nredis.expire(\"temp\", 2)\n```","summary":"

    Set a timeout on key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"seconds","doc":null,"default_value":"","external_name":"seconds","restriction":""}],"args_string":"(key, seconds)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1533","def":{"name":"expire","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"seconds","doc":null,"default_value":"","external_name":"seconds","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXPIRE\", key.to_s, seconds.to_s])"}},{"id":"expireat(key,unix_date)-instance-method","html_id":"expireat(key,unix_date)-instance-method","name":"expireat","doc":"EXPIREAT has the same effect and semantic as EXPIRE, but instead of\nspecifying the number of seconds representing the TTL (time to live),\nit takes an absolute Unix timestamp (seconds since January 1, 1970).\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date","doc":null,"default_value":"","external_name":"unix_date","restriction":""}],"args_string":"(key, unix_date)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1554","def":{"name":"expireat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date","doc":null,"default_value":"","external_name":"unix_date","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"EXPIREAT\", key.to_s, unix_date.to_s])"}},{"id":"flushall-instance-method","html_id":"flushall-instance-method","name":"flushall","doc":"Flush all databases.\n\n**Return value**: \"OK\"","summary":"

    Flush all databases.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1511","def":{"name":"flushall","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"FLUSHALL\"])"}},{"id":"flushdb-instance-method","html_id":"flushdb-instance-method","name":"flushdb","doc":"Flush the current database.\n\n**Return value**: \"OK\"","summary":"

    Flush the current database.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1504","def":{"name":"flushdb","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"FLUSHDB\"])"}},{"id":"get(key)-instance-method","html_id":"get(key)-instance-method","name":"get","doc":"Get the value of key.\n\n**Return value**: a String or nil\n\nExample:\n\n```\nredis.set(\"foo\", \"test\")\nredis.get(\"foo\") # => \"test\"\n```","summary":"

    Get the value of key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L66","def":{"name":"get","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"GET\", key.to_s])"}},{"id":"getbit(key,index)-instance-method","html_id":"getbit(key,index)-instance-method","name":"getbit","doc":"Returns the bit value at offset in the string value stored at key.\n\n**Return value**: Integer, the bit value stored at offset.","summary":"

    Returns the bit value at offset in the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"args_string":"(key, index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L452","def":{"name":"getbit","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"GETBIT\", key.to_s, index.to_s])"}},{"id":"getrange(key,start_index,end_index)-instance-method","html_id":"getrange(key,start_index,end_index)-instance-method","name":"getrange","doc":"Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).\n\n\nExample:\n\n```\nredis.set(\"foo\", \"This is a string\")\nredis.getrange(\"foo\", 0, 3) # => \"This\"\nredis.getrange(\"foo\", -3, -1) # => \"ing\"\n```","summary":"

    Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"end_index","doc":null,"default_value":"","external_name":"end_index","restriction":""}],"args_string":"(key, start_index, end_index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L387","def":{"name":"getrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"end_index","doc":null,"default_value":"","external_name":"end_index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"GETRANGE\", key.to_s, start_index.to_s, end_index.to_s])"}},{"id":"getset(key,value)-instance-method","html_id":"getset(key,value)-instance-method","name":"getset","doc":"Atomically sets key to value and returns the old value stored at key.\n\n**Return value**: String, the old value stored at key, or nil when key did not exist.\n\nExample:\n\n```\nredis.getset(\"foo\", \"new\") # => (the old value)\n```","summary":"

    Atomically sets key to value and returns the old value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L251","def":{"name":"getset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"GETSET\", key.to_s, value])"}},{"id":"hdel(key,field)-instance-method","html_id":"hdel(key,field)-instance-method","name":"hdel","doc":"Removes the specified fields from the hash stored at key.\n\n**Return value**: Integer, the number of fields that were removed from the hash,\nnot including specified but non existing fields.","summary":"

    Removes the specified fields from the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1000","def":{"name":"hdel","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HDEL\", key.to_s, field.to_s])"}},{"id":"hexists(key,field)-instance-method","html_id":"hexists(key,field)-instance-method","name":"hexists","doc":"Returns if field is an existing field in the hash stored at key.\n\n**Return value**: Integer, specifically:\n* 1 if the hash contains field.\n* 0 if the hash does not contain field, or key does not exist.","summary":"

    Returns if field is an existing field in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1009","def":{"name":"hexists","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HEXISTS\", key.to_s, field.to_s])"}},{"id":"hget(key,field)-instance-method","html_id":"hget(key,field)-instance-method","name":"hget","doc":"Returns the value associated with field in the hash stored at key.\n\n**Return value**: String, the value associated with field, or nil\n\nExample:\n\n```\nredis.hget(\"myhash\", \"a\") # => \"434\"\n```","summary":"

    Returns the value associated with field in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"args_string":"(key, field)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L984","def":{"name":"hget","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"HGET\", key.to_s, field.to_s])"}},{"id":"hgetall(key)-instance-method","html_id":"hgetall(key)-instance-method","name":"hgetall","doc":"Returns all fields and values of the hash stored at key.\n\n**Return value**: Array(String) of fields and their values stored in the hash,\nor an empty array when key does not exist.","summary":"

    Returns all fields and values of the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L992","def":{"name":"hgetall","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HGETALL\", key.to_s])"}},{"id":"hincrby(key,field,increment)-instance-method","html_id":"hincrby(key,field,increment)-instance-method","name":"hincrby","doc":"Increments the number stored at field in the hash stored at key by increment.\n\n**Return value**: Integer, the value at field after the increment operation.\n\nExample:\n\n```\nredis.hincrby(\"myhash\", \"field1\", \"3\") # => 4\n```","summary":"

    Increments the number stored at field in the hash stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, field, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1022","def":{"name":"hincrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HINCRBY\", key.to_s, field.to_s, increment.to_s])"}},{"id":"hincrbyfloat(key,field,increment)-instance-method","html_id":"hincrbyfloat(key,field,increment)-instance-method","name":"hincrbyfloat","doc":"Increment the specified field of an hash stored at key,\nand representing a floating point number, by the specified increment.\n\n**Return value**: String, the value at field after the increment operation.","summary":"

    Increment the specified field of an hash stored at key, and representing a floating point number, by the specified increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, field, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1030","def":{"name":"hincrbyfloat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"HINCRBYFLOAT\", key.to_s, field.to_s, increment.to_s])"}},{"id":"hkeys(key)-instance-method","html_id":"hkeys(key)-instance-method","name":"hkeys","doc":"Returns all field names in the hash stored at key.\n\n**Return value**: Array(String) - list of fields in the hash, or an empty list when key does not exist.","summary":"

    Returns all field names in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1037","def":{"name":"hkeys","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HKEYS\", key.to_s])"}},{"id":"hlen(key)-instance-method","html_id":"hlen(key)-instance-method","name":"hlen","doc":"Returns the number of fields contained in the hash stored at key.\n\n**Return value**: Integer, the number of fields in the hash, or 0 when key does not exist.","summary":"

    Returns the number of fields contained in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1044","def":{"name":"hlen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HLEN\", key.to_s])"}},{"id":"hmget(key,*fields:String):Array(RedisValue)-instance-method","html_id":"hmget(key,*fields:String):Array(RedisValue)-instance-method","name":"hmget","doc":"Returns the values associated with the specified fields in the hash stored at key.\n\n**Return value**: Array(RedisValue), the list of values associated with the given fields, in the same order as they are requested.","summary":"

    Returns the values associated with the specified fields in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":"String"}],"args_string":"(key, *fields : String) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1056","def":{"name":"hmget","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"hmget(key, fields.to_a)"}},{"id":"hmget(key,fields:Array(String)):Array(RedisValue)-instance-method","html_id":"hmget(key,fields:Array(String)):Array(RedisValue)-instance-method","name":"hmget","doc":"Returns the values associated with the specified fields in the hash stored at key.\n\n**Return value**: Array(RedisValue), the list of values associated with the given fields, in the same order as they are requested.","summary":"

    Returns the values associated with the specified fields in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":"Array(String)"}],"args_string":"(key, fields : Array(String)) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1051","def":{"name":"hmget","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"fields","doc":null,"default_value":"","external_name":"fields","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"string_array_command(concat([\"HMGET\", key.to_s], fields))"}},{"id":"hmset(key,hash)-instance-method","html_id":"hmset(key,hash)-instance-method","name":"hmset","doc":"Sets the specified fields to their respective values in the hash stored at key.\n\n**Return value**: \"OK\"","summary":"

    Sets the specified fields to their respective values in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"args_string":"(key, hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1063","def":{"name":"hmset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"HMSET\", key.to_s] of RedisValue\nhash.each do |field, value|\n (q << field.to_s) << value.to_s\nend\nstring_command(q)\n"}},{"id":"hscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"hscan(key,cursor,match=nil,count=nil)-instance-method","name":"hscan","doc":"```\nredis.hscan(\"myhash\", 0)\nredis.hscan(\"myhash\", 0, \"foo*\")\nredis.hscan(\"myhash\", 0, \"foo*\", 1024)\n```","summary":"

    ` redis.hscan(\"myhash\", 0) redis.hscan(\"myhash\", 0, \"foo\") redis.hscan(\"myhash\", 0, \"foo\", 1024) `

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1083","def":{"name":"hscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"HSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"hset(key,field,value)-instance-method","html_id":"hset(key,field,value)-instance-method","name":"hset","doc":"Sets field in the hash stored at key to value.\n\n**Return value**: Integer, specifically:\n* 1 if field is a new field in the hash and value was set.\n* 0 if field already exists in the hash and the value was updated.\n\nExample:\n\n```\nredis.hset(\"myhash\", \"a\", \"434\")\n```","summary":"

    Sets field in the hash stored at key to value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, field, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L971","def":{"name":"hset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HSET\", key.to_s, field.to_s, value.to_s])"}},{"id":"hsetnx(key,field,value)-instance-method","html_id":"hsetnx(key,field,value)-instance-method","name":"hsetnx","doc":"Sets field in the hash stored at key to value, only if field does not yet exist.\n\n**Return value**: Integer, specifically:\n* 1 if field is a new field in the hash and value was set.\n* 0 if field already exists in the hash and no operation was performed.","summary":"

    Sets field in the hash stored at key to value, only if field does not yet exist.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, field, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1095","def":{"name":"hsetnx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"field","doc":null,"default_value":"","external_name":"field","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"HSETNX\", key.to_s, field.to_s, value.to_s])"}},{"id":"hvals(key)-instance-method","html_id":"hvals(key)-instance-method","name":"hvals","doc":"Returns all values in the hash stored at key.\n\n**Return value**: Array(String), the list of values in the hash, or an empty list when key does not exist.","summary":"

    Returns all values in the hash stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1102","def":{"name":"hvals","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"HVALS\", key.to_s])"}},{"id":"incr(key)-instance-method","html_id":"incr(key)-instance-method","name":"incr","doc":"Increments the number stored at key by one.\n\n**Return value**: Integer: the value of key after the increment\n\nExample:\n\n```\nredis.set(\"foo\", \"3\")\nredis.incr(\"foo\") # => 4\n```","summary":"

    Increments the number stored at key by one.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L312","def":{"name":"incr","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"INCR\", key.to_s])"}},{"id":"incrby(key,increment)-instance-method","html_id":"incrby(key,increment)-instance-method","name":"incrby","doc":"Increments the number stored at key by increment.\n\n**Return value**: Integer, the value of key after the increment\n\nExample:\n\n```\nredis.incrby(\"foo\", 4)\n```","summary":"

    Increments the number stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L332","def":{"name":"incrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"INCRBY\", key.to_s, increment.to_s])"}},{"id":"incrbyfloat(key,increment)-instance-method","html_id":"incrbyfloat(key,increment)-instance-method","name":"incrbyfloat","doc":"Increment the string representing a floating point number stored at key by the specified increment.\n\n**Return value**: Integer, the value of key after the increment\n\nExample:\n\n```\nredis.incrbyfloat(\"foo\", 2.5)\n```","summary":"

    Increment the string representing a floating point number stored at key by the specified increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"args_string":"(key, increment)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L345","def":{"name":"incrbyfloat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"INCRBYFLOAT\", key.to_s, increment.to_s])"}},{"id":"info(section:String?=nil)-instance-method","html_id":"info(section:String?=nil)-instance-method","name":"info","doc":"The INFO command returns information and statistics about the server.\n\n**Return value**: A hash with the server information","summary":"

    The INFO command returns information and statistics about the server.

    ","abstract":false,"args":[{"name":"section","doc":null,"default_value":"nil","external_name":"section","restriction":"String | ::Nil"}],"args_string":"(section : String? = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1754","def":{"name":"info","args":[{"name":"section","doc":null,"default_value":"nil","external_name":"section","restriction":"String | ::Nil"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"arr = [\"INFO\"]\nif section\n arr << section\nend\nbulk = string_command(arr)\nresults = Hash(String, String).new\n(bulk.split(\"\\r\\n\")).each do |line|\n if line.empty? || (line[0] == '#')\n next\n end\n key, val = line.split(\":\")\n results[key] = val\nend\nresults\n"}},{"id":"keys(pattern)-instance-method","html_id":"keys(pattern)-instance-method","name":"keys","doc":"Returns all keys matching pattern.\n\n**Return value**: Array(String), array of keys matching pattern.\n\nExample:\n\n```\nredis.keys(\"callmemaybe\")\n```","summary":"

    Returns all keys matching pattern.

    ","abstract":false,"args":[{"name":"pattern","doc":null,"default_value":"","external_name":"pattern","restriction":""}],"args_string":"(pattern)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L558","def":{"name":"keys","args":[{"name":"pattern","doc":null,"default_value":"","external_name":"pattern","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"KEYS\", pattern.to_s])"}},{"id":"lindex(key,index)-instance-method","html_id":"lindex(key,index)-instance-method","name":"lindex","doc":"Returns the element at index index in the list stored at key.\n\n**Return value**: String, the requested element, or nil when index is out of range.","summary":"

    Returns the element at index index in the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"args_string":"(key, index)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L629","def":{"name":"lindex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"LINDEX\", key.to_s, index.to_s])"}},{"id":"linsert(key,where,pivot,value)-instance-method","html_id":"linsert(key,where,pivot,value)-instance-method","name":"linsert","doc":"Inserts value in the list stored at key either before or after the reference value pivot.\n\n**Options**:\n\n* where - either \"BEFORE\" or \"AFTER\"\n\n**Return value**: Integer, the length of the list after the insert operation, or -1 when the value pivot was not found.","summary":"

    Inserts value in the list stored at key either before or after the reference value pivot.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"where","doc":null,"default_value":"","external_name":"where","restriction":""},{"name":"pivot","doc":null,"default_value":"","external_name":"pivot","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, where, pivot, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L667","def":{"name":"linsert","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"where","doc":null,"default_value":"","external_name":"where","restriction":""},{"name":"pivot","doc":null,"default_value":"","external_name":"pivot","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LINSERT\", key.to_s, where.to_s, pivot.to_s, value.to_s])"}},{"id":"llen(key)-instance-method","html_id":"llen(key)-instance-method","name":"llen","doc":"Returns the length of the list stored at key.\n\n**Return value**: Integer, the length of the list at key.","summary":"

    Returns the length of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L622","def":{"name":"llen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LLEN\", key.to_s])"}},{"id":"lpop(key)-instance-method","html_id":"lpop(key)-instance-method","name":"lpop","doc":"Removes and returns the first element of the list stored at key.\n\n**Return value**: String, the value of the first element, or nil when key does not exist.\n\nExample:\n\n```\nredis.lpop(\"mylist\")\n```","summary":"

    Removes and returns the first element of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L649","def":{"name":"lpop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"LPOP\", key.to_s])"}},{"id":"lpush(key,*values)-instance-method","html_id":"lpush(key,*values)-instance-method","name":"lpush","doc":"Insert all the specified values at the head of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Insert all the specified values at the head of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L583","def":{"name":"lpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"lpush(key, values.to_a)"}},{"id":"lpush(key,values:Array(RedisValue))-instance-method","html_id":"lpush(key,values:Array(RedisValue))-instance-method","name":"lpush","doc":"Insert all the specified values at the head of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Insert all the specified values at the head of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L588","def":{"name":"lpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"LPUSH\", key.to_s], values))"}},{"id":"lpushx(key,value)-instance-method","html_id":"lpushx(key,value)-instance-method","name":"lpushx","doc":"Inserts value at the head of the list stored at key, only if key already exists and holds a list.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Inserts value at the head of the list stored at key, only if key already exists and holds a list.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L595","def":{"name":"lpushx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LPUSHX\", key.to_s, value.to_s])"}},{"id":"lrange(key,from,to)-instance-method","html_id":"lrange(key,from,to)-instance-method","name":"lrange","doc":"Returns the specified elements of the list stored at key.\n\n**Return value**: Array(String), the list of elements in the specified range.\n\nExample:\n\n```\nredis.lrange(\"mylist\", 0, 2)\n```","summary":"

    Returns the specified elements of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"","external_name":"to","restriction":""}],"args_string":"(key, from, to)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L680","def":{"name":"lrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"from","doc":null,"default_value":"","external_name":"from","restriction":""},{"name":"to","doc":null,"default_value":"","external_name":"to","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"LRANGE\", key.to_s, from.to_s, to.to_s])"}},{"id":"lrem(key,count,value)-instance-method","html_id":"lrem(key,count,value)-instance-method","name":"lrem","doc":"Removes the first count occurrences of elements equal to value from the list stored at key.\n\n**Return value**: Integer, the number of removed elements.\n\nExample:\n\n```\nredis.lrem(\"mylist\", 1, \"my\")\n```","summary":"

    Removes the first count occurrences of elements equal to value from the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"","external_name":"count","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, count, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L615","def":{"name":"lrem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"","external_name":"count","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"LREM\", key.to_s, count.to_s, value.to_s])"}},{"id":"lset(key,index,value)-instance-method","html_id":"lset(key,index,value)-instance-method","name":"lset","doc":"Sets the list element at index to value.\n\n**Return value**: \"OK\"","summary":"

    Sets the list element at index to value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L636","def":{"name":"lset","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"LSET\", key.to_s, index.to_s, value.to_s])"}},{"id":"ltrim(key,start,stop)-instance-method","html_id":"ltrim(key,start,stop)-instance-method","name":"ltrim","doc":"Trim an existing list so that it will contain only the specified range of elements specified.\n\n**Return value**: \"OK\"","summary":"

    Trim an existing list so that it will contain only the specified range of elements specified.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L687","def":{"name":"ltrim","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"LTRIM\", key.to_s, start.to_s, stop.to_s])"}},{"id":"mget(keys:Array(String)):Array(RedisValue)-instance-method","html_id":"mget(keys:Array(String)):Array(RedisValue)-instance-method","name":"mget","doc":null,"summary":null,"abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String)) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L223","def":{"name":"mget","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"string_array_command(concat([\"MGET\"], keys))"}},{"id":"mget(*keys)-instance-method","html_id":"mget(*keys)-instance-method","name":"mget","doc":"Returns the values of all specified keys.\n\n**Return value**: Array(String), the list of values at the specified keys.\nFor every key that does not hold a string value or does not exist, nil is returned.\n\nExample:\n\n```\nredis.set(\"foo1\", \"test1\")\nredis.set(\"foo2\", \"test2\")\nredis.mget(\"foo1\", \"foo2\") # => [\"test1\", \"test2\"]\n```","summary":"

    Returns the values of all specified keys.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L219","def":{"name":"mget","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"MGET\"], keys))"}},{"id":"mset(hash:Hash)-instance-method","html_id":"mset(hash:Hash)-instance-method","name":"mset","doc":"Sets the given keys to their respective values as defined in the hash.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.mset({\"foo1\": \"bar1\", \"foo2\": \"bar2\"})\n```","summary":"

    Sets the given keys to their respective values as defined in the hash.

    ","abstract":false,"args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":"Hash"}],"args_string":"(hash : Hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L236","def":{"name":"mset","args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":"Hash"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"MSET\"] of RedisValue\nhash.each do |key, value|\n (q << key.to_s) << value.to_s\nend\nstring_command(q)\n"}},{"id":"msetnx(hash)-instance-method","html_id":"msetnx(hash)-instance-method","name":"msetnx","doc":"Sets the given keys to their respective values as defined in the hash.\nMSETNX will not perform any operation at all even if just a single key already exists.\n\n**Return value**: Integer, specifically:\n* 1 if the all the keys were set.\n* 0 if no key was set (at least one key already existed).\n\nExample:\n\n```\nredis.msetnx({\"key1\": \"hello\", \"key2\": \"there\"})\n```","summary":"

    Sets the given keys to their respective values as defined in the hash.

    ","abstract":false,"args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"args_string":"(hash)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L296","def":{"name":"msetnx","args":[{"name":"hash","doc":null,"default_value":"","external_name":"hash","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"MSETNX\"] of RedisValue\nhash.each do |key, value|\n (q << key.to_s) << value\nend\ninteger_command(q)\n"}},{"id":"object_encoding(key)-instance-method","html_id":"object_encoding(key)-instance-method","name":"object_encoding","doc":"Returns the kind of internal representation used in order to store\nthe value associated with a key.\n\n**Return value**: String: returns the kind of internal representation\nused in order to store the value associated with a key.","summary":"

    Returns the kind of internal representation used in order to store the value associated with a key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1781","def":{"name":"object_encoding","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"OBJECT\", \"ENCODING\", key.to_s])"}},{"id":"object_idletime(key)-instance-method","html_id":"object_idletime(key)-instance-method","name":"object_idletime","doc":"Returns the number of seconds since the object stored at the specified key\nis idle (not requested by read or write operations).\n\n**Return value**: Integer: returns the number of seconds\nsince the object stored at the specified key is idle\n(not requested by read or write operations).","summary":"

    Returns the number of seconds since the object stored at the specified key is idle (not requested by read or write operations).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1791","def":{"name":"object_idletime","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"OBJECT\", \"IDLETIME\", key.to_s])"}},{"id":"object_refcount(key)-instance-method","html_id":"object_refcount(key)-instance-method","name":"object_refcount","doc":"Returns the number of references of the value associated\nwith the specified key.\n\n**Return value**: Integer: returns the number of references\nof the value associated with the specified key.","summary":"

    Returns the number of references of the value associated with the specified key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1772","def":{"name":"object_refcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"OBJECT\", \"REFCOUNT\", key.to_s])"}},{"id":"persist(key)-instance-method","html_id":"persist(key)-instance-method","name":"persist","doc":"Remove the existing timeout on key, turning the key from volatile\n(a key with an expire set) to persistent (a key that will never expire\nas no timeout is associated).\n\n**Return value**: Integer, specifically:\n* 1 if the timeout was removed.\n* 0 if key does not exist or does not have an associated timeout.","summary":"

    Remove the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1575","def":{"name":"persist","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PERSIST\", key.to_s])"}},{"id":"pexpire(key,milis)-instance-method","html_id":"pexpire(key,milis)-instance-method","name":"pexpire","doc":"This command works exactly like EXPIRE but the time to live of the key is\nspecified in milliseconds instead of seconds.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"milis","doc":null,"default_value":"","external_name":"milis","restriction":""}],"args_string":"(key, milis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1543","def":{"name":"pexpire","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"milis","doc":null,"default_value":"","external_name":"milis","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PEXPIRE\", key.to_s, milis.to_s])"}},{"id":"pexpireat(key,unix_date_in_millis)-instance-method","html_id":"pexpireat(key,unix_date_in_millis)-instance-method","name":"pexpireat","doc":"PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time\nat which the key will expire is specified in milliseconds instead of seconds.\n\n**Return value**: Integeger, specifically:\n* 1 if the timeout was set.\n* 0 if key does not exist or the timeout could not be set.","summary":"

    PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time at which the key will expire is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date_in_millis","doc":null,"default_value":"","external_name":"unix_date_in_millis","restriction":""}],"args_string":"(key, unix_date_in_millis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1564","def":{"name":"pexpireat","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"unix_date_in_millis","doc":null,"default_value":"","external_name":"unix_date_in_millis","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PEXPIREAT\", key.to_s, unix_date_in_millis.to_s])"}},{"id":"pfadd(key,*values:String):Int64-instance-method","html_id":"pfadd(key,*values:String):Int64-instance-method","name":"pfadd","doc":"Adds all the element arguments to the HyperLogLog data structure stored at\nthe variable name specified as first argument.\n\n**Return value**: Integer: 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.\n\nExample:\n\n```\nredis.pfadd(\"hll\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\") # => 1\n```","summary":"

    Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"String"}],"args_string":"(key, *values : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1416","def":{"name":"pfadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"pfadd(key, values.to_a)"}},{"id":"pfadd(key,values:Array(String)):Int64-instance-method","html_id":"pfadd(key,values:Array(String)):Int64-instance-method","name":"pfadd","doc":"Adds all the element arguments to the HyperLogLog data structure stored at\nthe variable name specified as first argument.\n\n**Return value**: Integer: 1 if at least 1 HyperLogLog internal register was altered. 0 otherwise.\n\nExample:\n\n```\nredis.pfadd(\"hll\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\") # => 1\n```","summary":"

    Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(String)"}],"args_string":"(key, values : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1411","def":{"name":"pfadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"PFADD\", key.to_s], values))"}},{"id":"pfcount(keys:Array(String)):Int64-instance-method","html_id":"pfcount(keys:Array(String)):Int64-instance-method","name":"pfcount","doc":"When called with a single key, returns the approximated cardinality computed\nby the HyperLogLog data structure stored at the specified variable,\nwhich is 0 if the variable does not exist.\n\n**Return value**: Integer, the approximated number of unique elements\nobserved via PFADD.","summary":"

    When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1438","def":{"name":"pfcount","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"PFCOUNT\"], keys))"}},{"id":"pfcount(*keys:String):Int64-instance-method","html_id":"pfcount(*keys:String):Int64-instance-method","name":"pfcount","doc":"When called with a single key, returns the approximated cardinality computed\nby the HyperLogLog data structure stored at the specified variable,\nwhich is 0 if the variable does not exist.\n\n**Return value**: Integer, the approximated number of unique elements\nobserved via PFADD.","summary":"

    When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(*keys : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1443","def":{"name":"pfcount","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"pfcount(keys.to_a)"}},{"id":"pfmerge(keys:Array(String))-instance-method","html_id":"pfmerge(keys:Array(String))-instance-method","name":"pfmerge","doc":"Merge multiple HyperLogLog values into an unique value that will\napproximate the cardinality of the union of the observed Sets of the\nsource HyperLogLog structures.","summary":"

    Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1423","def":{"name":"pfmerge","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command(concat([\"PFMERGE\"], keys))"}},{"id":"pfmerge(*keys:String)-instance-method","html_id":"pfmerge(*keys:String)-instance-method","name":"pfmerge","doc":"Merge multiple HyperLogLog values into an unique value that will\napproximate the cardinality of the union of the observed Sets of the\nsource HyperLogLog structures.","summary":"

    Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(*keys : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1428","def":{"name":"pfmerge","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"pfmerge(keys.to_a)"}},{"id":"ping-instance-method","html_id":"ping-instance-method","name":"ping","doc":"Returns PONG. This command is often used to test if a connection is still alive, or to measure latency.\n\nExample:\n\n```\nredis.ping # => \"PONG\"\n```","summary":"

    Returns PONG.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L23","def":{"name":"ping","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"PING\"])"}},{"id":"psetex(key,expire_in_milis,value)-instance-method","html_id":"psetex(key,expire_in_milis,value)-instance-method","name":"psetex","doc":"PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.\n\n**Return value**: \"OK\"","summary":"

    PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_milis","doc":null,"default_value":"","external_name":"expire_in_milis","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, expire_in_milis, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L271","def":{"name":"psetex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_milis","doc":null,"default_value":"","external_name":"expire_in_milis","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"PSETEX\", key.to_s, expire_in_milis.to_s, value.to_s])"}},{"id":"psubscribe(*channel_patterns)-instance-method","html_id":"psubscribe(*channel_patterns)-instance-method","name":"psubscribe","doc":null,"summary":null,"abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1693","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"psubscribe(channel_patterns.to_a)"}},{"id":"psubscribe(channel_patterns:Array(String))-instance-method","html_id":"psubscribe(channel_patterns:Array(String))-instance-method","name":"psubscribe","doc":"Subscribes to more channel patterns while already being in a subscription loop.","summary":"

    Subscribes to more channel patterns while already being in a subscription loop.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":"Array(String)"}],"args_string":"(channel_patterns : Array(String))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1684","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\nelse\n raise(Redis::Error.new(\"Must call psubscribe with a subscription block\"))\nend\nvoid_command(concat([\"PSUBSCRIBE\"], channel_patterns))\n"}},{"id":"psubscribe(*channel_patterns,&callback_setup_block:Subscription->)-instance-method","html_id":"psubscribe(*channel_patterns,&callback_setup_block:Subscription->)-instance-method","name":"psubscribe","doc":"Subscribes to channel patterns and enters a subscription loop, waiting for events.\n\nThe method yields to the given block and passes a Subscription object, on\nwhich you can set your callbacks for the event subscription.\n\nThe subscription loop will end once you unsubscribe.","summary":"

    Subscribes to channel patterns and enters a subscription loop, waiting for events.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns, &callback_setup_block : Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1668","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Subscription -> )"},"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\n raise(Redis::Error.new(\"Must call psubscribe without a subscription block when inside a subscription loop\"))\nend\nsubscription = Subscription.new\ncallback_setup_block.call(subscription)\n@strategy = Redis::Strategy::SubscriptionLoop.new(connection, subscription)\npsubscribe(*channel_patterns)\n"}},{"id":"pttl(key)-instance-method","html_id":"pttl(key)-instance-method","name":"pttl","doc":"Like TTL this command returns the remaining time to live of a key that has\nan expire set, with the sole difference that TTL returns the amount of\nremaining time in seconds while PTTL returns it in milliseconds.\n\n**Return value**: Integer, the TTL in milliseconds, or a negative value in order to signal an error.","summary":"

    Like TTL this command returns the remaining time to live of a key that has an expire set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1592","def":{"name":"pttl","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PTTL\", key.to_s])"}},{"id":"publish(channel,message)-instance-method","html_id":"publish(channel,message)-instance-method","name":"publish","doc":"Posts a message to the given channel.\n\n**Return value**: Integer, the number of clients that received the message.\n\nExample:\n\n```\nredis.publish(\"mychannel\", \"some message\")\n```","summary":"

    Posts a message to the given channel.

    ","abstract":false,"args":[{"name":"channel","doc":null,"default_value":"","external_name":"channel","restriction":""},{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"args_string":"(channel, message)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1729","def":{"name":"publish","args":[{"name":"channel","doc":null,"default_value":"","external_name":"channel","restriction":""},{"name":"message","doc":null,"default_value":"","external_name":"message","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"PUBLISH\", channel.to_s, message.to_s])"}},{"id":"punsubscribe(*channel_patterns)-instance-method","html_id":"punsubscribe(*channel_patterns)-instance-method","name":"punsubscribe","doc":"Unsubscribes the client from the given patterns, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given patterns, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1716","def":{"name":"punsubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"punsubscribe(channel_patterns.to_a)"}},{"id":"punsubscribe(channel_patterns:Array(String))-instance-method","html_id":"punsubscribe(channel_patterns:Array(String))-instance-method","name":"punsubscribe","doc":"Unsubscribes the client from the given patterns, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given patterns, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":"Array(String)"}],"args_string":"(channel_patterns : Array(String))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1711","def":{"name":"punsubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"void_command(concat([\"PUNSUBSCRIBE\"], channel_patterns))"}},{"id":"quit-instance-method","html_id":"quit-instance-method","name":"quit","doc":"Ask the server to close the connection. The connection is closed as soon as all pending replies have been written to the client.\n\n**Return value**: \"OK\"","summary":"

    Ask the server to close the connection.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L73","def":{"name":"quit","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"QUIT\"])"}},{"id":"randomkey-instance-method","html_id":"randomkey-instance-method","name":"randomkey","doc":"Return a random key from the currently selected database.","summary":"

    Return a random key from the currently selected database.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L536","def":{"name":"randomkey","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"RANDOMKEY\"])"}},{"id":"rename(old_key,new_key)-instance-method","html_id":"rename(old_key,new_key)-instance-method","name":"rename","doc":"Renames old_key to newkey.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.rename(\"old_name\", \"new_name\")\n```","summary":"

    Renames old_key to newkey.

    ","abstract":false,"args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"args_string":"(old_key, new_key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L107","def":{"name":"rename","args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"RENAME\", old_key.to_s, new_key.to_s])"}},{"id":"renamenx(old_key,new_key)-instance-method","html_id":"renamenx(old_key,new_key)-instance-method","name":"renamenx","doc":"Renames old_key to newkey if newkey does not yet exist.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.renamenx(\"old_name\", \"new_name\")\n```","summary":"

    Renames old_key to newkey if newkey does not yet exist.

    ","abstract":false,"args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"args_string":"(old_key, new_key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L120","def":{"name":"renamenx","args":[{"name":"old_key","doc":null,"default_value":"","external_name":"old_key","restriction":""},{"name":"new_key","doc":null,"default_value":"","external_name":"new_key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"RENAMENX\", old_key.to_s, new_key.to_s])"}},{"id":"restore(key,ttl_in_milis:Int,serialized_value:String,replace=false)-instance-method","html_id":"restore(key,ttl_in_milis:Int,serialized_value:String,replace=false)-instance-method","name":"restore","doc":"Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP).\n\n**Return value**: The command returns \"OK\" on success.","summary":"

    Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"ttl_in_milis","doc":null,"default_value":"","external_name":"ttl_in_milis","restriction":"Int"},{"name":"serialized_value","doc":null,"default_value":"","external_name":"serialized_value","restriction":"String"},{"name":"replace","doc":null,"default_value":"false","external_name":"replace","restriction":""}],"args_string":"(key, ttl_in_milis : Int, serialized_value : String, replace = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L504","def":{"name":"restore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"ttl_in_milis","doc":null,"default_value":"","external_name":"ttl_in_milis","restriction":"Int"},{"name":"serialized_value","doc":null,"default_value":"","external_name":"serialized_value","restriction":"String"},{"name":"replace","doc":null,"default_value":"false","external_name":"replace","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"RESTORE\", key.to_s, ttl_in_milis.to_s, serialized_value]\nif replace\n q << \"REPLACE\"\nend\nstring_command(q)\n"}},{"id":"rpop(key)-instance-method","html_id":"rpop(key)-instance-method","name":"rpop","doc":"Removes and returns the last element of the list stored at key.\n\n**Return value**: \"OK\"","summary":"

    Removes and returns the last element of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L656","def":{"name":"rpop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"RPOP\", key.to_s])"}},{"id":"rpoplpush(source,destination)-instance-method","html_id":"rpoplpush(source,destination)-instance-method","name":"rpoplpush","doc":"Atomically returns and removes the last element (tail) of the list stored at source,\nand pushes the element at the first element (head) of the list stored at destination.\n\n**Return value**: String, the element being popped and pushed.","summary":"

    Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""}],"args_string":"(source, destination)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L931","def":{"name":"rpoplpush","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"RPOPLPUSH\", source.to_s, destination.to_s])"}},{"id":"rpush(key,*values:String)-instance-method","html_id":"rpush(key,*values:String)-instance-method","name":"rpush","doc":"Insert all the specified values at the tail of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.\n\nExample:\n\n```\nredis.rpush(\"mylist\", \"1\", \"2\", \"3\")\n```","summary":"

    Insert all the specified values at the tail of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"String"}],"args_string":"(key, *values : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L576","def":{"name":"rpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"rpush(key, values.to_a)"}},{"id":"rpush(key,values:Array(RedisValue))-instance-method","html_id":"rpush(key,values:Array(RedisValue))-instance-method","name":"rpush","doc":"Insert all the specified values at the tail of the list stored at key.\n\n**Return value**: Integer, the length of the list after the push operation.\n\nExample:\n\n```\nredis.rpush(\"mylist\", \"1\", \"2\", \"3\")\n```","summary":"

    Insert all the specified values at the tail of the list stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L571","def":{"name":"rpush","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"RPUSH\", key.to_s], values))"}},{"id":"rpushx(key,value)-instance-method","html_id":"rpushx(key,value)-instance-method","name":"rpushx","doc":"Inserts value at the tail of the list stored at key, only if key already exists and holds a list.\n\n**Return value**: Integer, the length of the list after the push operation.","summary":"

    Inserts value at the tail of the list stored at key, only if key already exists and holds a list.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L602","def":{"name":"rpushx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"RPUSHX\", key.to_s, value.to_s])"}},{"id":"sadd(key,*values)-instance-method","html_id":"sadd(key,*values)-instance-method","name":"sadd","doc":"Add the specified members to the set stored at key.\n\n**Return value**: Integer, the number of elements that were added to the set, not including all the elements already present into the set.","summary":"

    Add the specified members to the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L694","def":{"name":"sadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"sadd(key, values.to_a)"}},{"id":"sadd(key,values:Array(RedisValue))-instance-method","html_id":"sadd(key,values:Array(RedisValue))-instance-method","name":"sadd","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L698","def":{"name":"sadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SADD\", key.to_s], values))"}},{"id":"scan(cursor,match=nil,count=nil)-instance-method","html_id":"scan(cursor,match=nil,count=nil)-instance-method","name":"scan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array of String, a list of keys.\n\nExample:\n\n```\nredis.scan(0)\nredis.scan(0, \"foo*\")\nredis.scan(0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L528","def":{"name":"scan","args":[{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SCAN\", cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"scard(key)-instance-method","html_id":"scard(key)-instance-method","name":"scard","doc":"Returns the set cardinality (number of elements) of the set stored at key.","summary":"

    Returns the set cardinality (number of elements) of the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L736","def":{"name":"scard","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SCARD\", key.to_s])"}},{"id":"script_exists(sha1_array:Array(Reference))-instance-method","html_id":"script_exists(sha1_array:Array(Reference))-instance-method","name":"script_exists","doc":"Returns information about the existence of the scripts in the script cache.\n\n**Return value**: The command returns an array of integers that correspond\nto the specified SHA1 digest arguments.\nFor every corresponding SHA1 digest of a script that actually exists\nin the script cache, an 1 is returned, otherwise 0 is returned.","summary":"

    Returns information about the existence of the scripts in the script cache.

    ","abstract":false,"args":[{"name":"sha1_array","doc":null,"default_value":"","external_name":"sha1_array","restriction":"Array(Reference)"}],"args_string":"(sha1_array : Array(Reference))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1497","def":{"name":"script_exists","args":[{"name":"sha1_array","doc":null,"default_value":"","external_name":"sha1_array","restriction":"Array(Reference)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_array_command(concat([\"SCRIPT\", \"EXISTS\"], sha1_array))"}},{"id":"script_flush-instance-method","html_id":"script_flush-instance-method","name":"script_flush","doc":"Flush the Lua scripts cache.\n\n**Return value**: \"OK\"","summary":"

    Flush the Lua scripts cache.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1518","def":{"name":"script_flush","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"FLUSH\"])"}},{"id":"script_kill-instance-method","html_id":"script_kill-instance-method","name":"script_kill","doc":"Kills the currently executing Lua script, assuming no write operation was\nyet performed by the script.\n\n**Return value**: \"OK\"","summary":"

    Kills the currently executing Lua script, assuming no write operation was yet performed by the script.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1487","def":{"name":"script_kill","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"KILL\"])"}},{"id":"script_load(script:String)-instance-method","html_id":"script_load(script:String)-instance-method","name":"script_load","doc":"Load a script into the scripts cache, without executing it.\n\n**Return value**: String, the SHA1 digest of the script\nadded into the script cache.\n\nExample:\n\n```\nredis.script_load(\"return {KEYS[1],ARGV[1]}\") # => \"a191862bfe0bd3bec995befcd060582bf4bdbd77\"\n```","summary":"

    Load a script into the scripts cache, without executing it.

    ","abstract":false,"args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"}],"args_string":"(script : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1479","def":{"name":"script_load","args":[{"name":"script","doc":null,"default_value":"","external_name":"script","restriction":"String"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SCRIPT\", \"LOAD\", script])"}},{"id":"sdiff(keys:Array(String)):Array(RedisValue)-instance-method","html_id":"sdiff(keys:Array(String)):Array(RedisValue)-instance-method","name":"sdiff","doc":"Returns the members of the set resulting from the difference between the first set and all the successive sets.\n\n**Return value**: Array(String), a list with members of the resulting set.","summary":"

    Returns the members of the set resulting from the difference between the first set and all the successive sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String)) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L743","def":{"name":"sdiff","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"string_array_command(concat([\"SDIFF\"], keys))"}},{"id":"sdiff(*keys:String):Array(RedisValue)-instance-method","html_id":"sdiff(*keys:String):Array(RedisValue)-instance-method","name":"sdiff","doc":null,"summary":null,"abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(*keys : String) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L747","def":{"name":"sdiff","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"sdiff(keys.to_a)"}},{"id":"sdiffstore(destination,*keys:String):Int64-instance-method","html_id":"sdiffstore(destination,*keys:String):Int64-instance-method","name":"sdiffstore","doc":"This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(destination, *keys : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L759","def":{"name":"sdiffstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"sdiffstore(destination, keys.to_a)"}},{"id":"sdiffstore(destination,keys:Array(String)):Int64-instance-method","html_id":"sdiffstore(destination,keys:Array(String)):Int64-instance-method","name":"sdiffstore","doc":"This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SDIFF, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(destination, keys : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L754","def":{"name":"sdiffstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"SDIFFSTORE\", destination.to_s], keys))"}},{"id":"select(database_number)-instance-method","html_id":"select(database_number)-instance-method","name":"select","doc":"Select the DB with having the specified zero-based numeric index.\n\n**Return value**: \"OK\"","summary":"

    Select the DB with having the specified zero-based numeric index.

    ","abstract":false,"args":[{"name":"database_number","doc":null,"default_value":"","external_name":"database_number","restriction":""}],"args_string":"(database_number)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L94","def":{"name":"select","args":[{"name":"database_number","doc":null,"default_value":"","external_name":"database_number","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SELECT\", database_number.to_s])"}},{"id":"set(key,value,ex=nil,px=nil,nx=nil,xx=nil)-instance-method","html_id":"set(key,value,ex=nil,px=nil,nx=nil,xx=nil)-instance-method","name":"set","doc":"Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type. Any previous time to live associated with the key is discarded on successful SET operation.\n\n**Options**:\n\n* Starting with Redis 2.6.12 SET supports a set of options that modify its behavior:\n* ex -- Set the specified expire time, in seconds.\n* px -- Set the specified expire time, in milliseconds.\n* nx -- Only set the key if it does not already exist.\n* xx -- Only set the key if it already exist.\n\n**Return value**:\n* OK if SET was executed correctly.\n* Null reply: nil is returned if the SET operation was not performed because the user specified the NX or XX option but the condition was not met.\n\nExample:\n\n```\nredis.set(\"foo\", \"test\")\nredis.set(\"bar\", \"test\", ex: 7)\n```","summary":"

    Set key to hold the string value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""},{"name":"ex","doc":null,"default_value":"nil","external_name":"ex","restriction":""},{"name":"px","doc":null,"default_value":"nil","external_name":"px","restriction":""},{"name":"nx","doc":null,"default_value":"nil","external_name":"nx","restriction":""},{"name":"xx","doc":null,"default_value":"nil","external_name":"xx","restriction":""}],"args_string":"(key, value, ex = nil, px = nil, nx = nil, xx = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L47","def":{"name":"set","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""},{"name":"ex","doc":null,"default_value":"nil","external_name":"ex","restriction":""},{"name":"px","doc":null,"default_value":"nil","external_name":"px","restriction":""},{"name":"nx","doc":null,"default_value":"nil","external_name":"nx","restriction":""},{"name":"xx","doc":null,"default_value":"nil","external_name":"xx","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SET\", key.to_s, value.to_s]\nif ex\n (q << \"EX\") << ex.to_s\nend\nif px\n (q << \"PX\") << px.to_s\nend\nif nx\n (q << \"NX\") << nx.to_s\nend\nif xx\n (q << \"XX\") << xx.to_s\nend\nstring_or_nil_command(q)\n"}},{"id":"setbit(key,index,value)-instance-method","html_id":"setbit(key,index,value)-instance-method","name":"setbit","doc":"Sets or clears the bit at offset in the string value stored at key.\n\n**Return value**: Integer: the original bit value stored at offset.\n\nExample:\n\n```\nredis.setbit(\"mykey\", 7, 1)\n```","summary":"

    Sets or clears the bit at offset in the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L465","def":{"name":"setbit","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"index","doc":null,"default_value":"","external_name":"index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETBIT\", key.to_s, index.to_s, value.to_s])"}},{"id":"setex(key,expire_in_seconds,value)-instance-method","html_id":"setex(key,expire_in_seconds,value)-instance-method","name":"setex","doc":"Set key to hold the string value and set key to timeout after a given number of seconds.\n\n**Return value**: \"OK\"\n\nExample:\n\n```\nredis.setex(\"foo\", 3, \"bar\")\n```","summary":"

    Set key to hold the string value and set key to timeout after a given number of seconds.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_seconds","doc":null,"default_value":"","external_name":"expire_in_seconds","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, expire_in_seconds, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L264","def":{"name":"setex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"expire_in_seconds","doc":null,"default_value":"","external_name":"expire_in_seconds","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"SETEX\", key.to_s, expire_in_seconds.to_s, value.to_s])"}},{"id":"setnx(key,value)-instance-method","html_id":"setnx(key,value)-instance-method","name":"setnx","doc":"Set key to hold string value if key does not exist.\n\n**Return value**: Integer, specifically:\n* 1 if the key was set\n* 0 if the key was not set","summary":"

    Set key to hold string value if key does not exist.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L280","def":{"name":"setnx","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETNX\", key.to_s, value.to_s])"}},{"id":"setrange(key,start_index,value)-instance-method","html_id":"setrange(key,start_index,value)-instance-method","name":"setrange","doc":"Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.\n\n**Return value**: Integer, the length of the string after it was modified by the command.\n\nExample:\n\n```\nredis.setrange(\"foo\", 6, \"Redis\")\n```","summary":"

    Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, start_index, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L400","def":{"name":"setrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start_index","doc":null,"default_value":"","external_name":"start_index","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SETRANGE\", key.to_s, start_index.to_s, value.to_s])"}},{"id":"sinter(keys:Array(String)):Array(RedisValue)-instance-method","html_id":"sinter(keys:Array(String)):Array(RedisValue)-instance-method","name":"sinter","doc":"Returns the members of the set resulting from the intersection of all the given sets.\n\n**Return value**: Array(String), an array with members of the resulting set.","summary":"

    Returns the members of the set resulting from the intersection of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String)) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L766","def":{"name":"sinter","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"string_array_command(concat([\"SINTER\"], keys))"}},{"id":"sinter(*keys:String):Array(RedisValue)-instance-method","html_id":"sinter(*keys:String):Array(RedisValue)-instance-method","name":"sinter","doc":"Returns the members of the set resulting from the intersection of all the given sets.\n\n**Return value**: Array(String), an array with members of the resulting set.","summary":"

    Returns the members of the set resulting from the intersection of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(*keys : String) : Array(RedisValue)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L771","def":{"name":"sinter","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"Array(RedisValue)","visibility":"Public","body":"sinter(keys.to_a)"}},{"id":"sinterstore(destination_key,*keys:String):Int64-instance-method","html_id":"sinterstore(destination_key,*keys:String):Int64-instance-method","name":"sinterstore","doc":"This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.\n\nExample:\n\n```\nredis.sinterstore(\"destination\", \"key1\", \"key2\")\n```","summary":"

    This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(destination_key, *keys : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L789","def":{"name":"sinterstore","args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"sinterstore(destination_key, keys.to_a)"}},{"id":"sinterstore(destination_key,keys:Array(String)):Int64-instance-method","html_id":"sinterstore(destination_key,keys:Array(String)):Int64-instance-method","name":"sinterstore","doc":"This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.\n\nExample:\n\n```\nredis.sinterstore(\"destination\", \"key1\", \"key2\")\n```","summary":"

    This command is equal to SINTER, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(destination_key, keys : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L784","def":{"name":"sinterstore","args":[{"name":"destination_key","doc":null,"default_value":"","external_name":"destination_key","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"SINTERSTORE\", destination_key.to_s], keys))"}},{"id":"sismember(key,value)-instance-method","html_id":"sismember(key,value)-instance-method","name":"sismember","doc":"Returns if member is a member of the set stored at key.\n\n**Return value**: Integer, specifically:\n* 1 if the element is a member of the set.\n* 0 if the element is not a member of the set, or if key does not exist.","summary":"

    Returns if member is a member of the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"args_string":"(key, value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L714","def":{"name":"sismember","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"value","doc":null,"default_value":"","external_name":"value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SISMEMBER\", key.to_s, value.to_s])"}},{"id":"smembers(key)-instance-method","html_id":"smembers(key)-instance-method","name":"smembers","doc":"Returns all the members of the set value stored at key.\n\n**Return value**: Array(String), all elements of the set.","summary":"

    Returns all the members of the set value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L705","def":{"name":"smembers","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command([\"SMEMBERS\", key.to_s])"}},{"id":"smove(source,destination,member)-instance-method","html_id":"smove(source,destination,member)-instance-method","name":"smove","doc":"Move member from the set at source to the set at destination.\n\n**Return value**: Integer, specifically:\n* 1 if the element is moved.\n* 0 if the element is not a member of source and no operation was performed.","summary":"

    Move member from the set at source to the set at destination.

    ","abstract":false,"args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(source, destination, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L798","def":{"name":"smove","args":[{"name":"source","doc":null,"default_value":"","external_name":"source","restriction":""},{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"SMOVE\", source.to_s, destination.to_s, member.to_s])"}},{"id":"sort(key,by=nil,limit=nil,get:Array(RedisValue)?=nil,order="ASC",alpha=false,store=nil)-instance-method","html_id":"sort(key,by=nil,limit=nil,get:Array(RedisValue)?=nil,order=&quot;ASC&quot;,alpha=false,store=nil)-instance-method","name":"sort","doc":"Returns or stores the elements contained in the list, set or sorted set at key.\n\n**Options**:\n\n* by - pattern for sorting by external keys\n* limit - Array of 2 strings [offset, count]\n* get - pattern for retrieving external keys\n* order - either 'ASC' or 'DESC'\n* alpha - true to sort lexicographically\n* store - key of destination list to store the result in\n\n**Return value**: Array(String), the list of sorted elements.\n\nExample:\n\n```\nredis.sort(\"mylist\") # => [...]\nredis.sort(\"mylist\", order: \"DESC\") # => [...]\n```","summary":"

    Returns or stores the elements contained in the list, set or sorted set at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"by","doc":null,"default_value":"nil","external_name":"by","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"get","doc":null,"default_value":"nil","external_name":"get","restriction":"Array(RedisValue) | ::Nil"},{"name":"order","doc":null,"default_value":"\"ASC\"","external_name":"order","restriction":""},{"name":"alpha","doc":null,"default_value":"false","external_name":"alpha","restriction":""},{"name":"store","doc":null,"default_value":"nil","external_name":"store","restriction":""}],"args_string":"(key, by = nil, limit = nil, get : Array(RedisValue)? = nil, order = "ASC", alpha = false, store = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L169","def":{"name":"sort","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"by","doc":null,"default_value":"nil","external_name":"by","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"get","doc":null,"default_value":"nil","external_name":"get","restriction":"Array(RedisValue) | ::Nil"},{"name":"order","doc":null,"default_value":"\"ASC\"","external_name":"order","restriction":""},{"name":"alpha","doc":null,"default_value":"false","external_name":"alpha","restriction":""},{"name":"store","doc":null,"default_value":"nil","external_name":"store","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SORT\", key.to_s]\nif by\n (q << \"BY\") << by.to_s\nend\nif limit\n if limit.size != 2\n raise(Error.new(\"limit must be an array of 2 elements (offset, count)\"))\n end\n offset, count = limit\n ((q << \"LIMIT\") << offset.to_s) << count.to_s\nend\nif get\n get.each do |pattern|\n (q << \"GET\") << pattern\n end\nend\nif order\n _order = order.upcase\n if [\"ASC\", \"DESC\"].includes?(_order)\n else\n raise(Error.new(\"Bad order #{order}\"))\n end\n q << _order\nend\nif alpha\n q << \"ALPHA\"\nend\nif store\n (q << \"STORE\") << store.to_s\nend\nstring_array_or_integer_command(q)\n"}},{"id":"spop(key,count=nil)-instance-method","html_id":"spop(key,count=nil)-instance-method","name":"spop","doc":"Removes and returns one or more random elements from the set value store at key.\n\nThe count argument will be available in a later Redis version and is not available in 2.6, 2.8, 3.0\n\n**Return value**: The removed element, or nil when key does not exist.","summary":"

    Removes and returns one or more random elements from the set value store at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L807","def":{"name":"spop","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SPOP\", key.to_s]\nif count\n q << count.to_s\nend\nstring_array_or_string_or_nil_command(q)\n"}},{"id":"srandmember(key,count=nil)-instance-method","html_id":"srandmember(key,count=nil)-instance-method","name":"srandmember","doc":"When called with just the key argument, return a random element from the set value stored at key.\n\n**Options**:\n\n* count - Starting from Redis version 2.6, when called with the additional count argument, return an array of count distinct elements if count is positive. If called with a negative count the behavior changes and the command is allowed to return the same element multiple times.\n\n**Return value**:\n* String: without the additional count argument the command returns a Bulk Reply with the randomly selected element, or nil when key does not exist.\n* Array: when the additional count argument is passed the command returns an array of elements, or an empty array when key does not exist.","summary":"

    When called with just the key argument, return a random element from the set value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L825","def":{"name":"srandmember","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SRANDMEMBER\", key.to_s]\nif count\n q << count.to_s\nend\nstring_array_or_string_or_nil_command(q)\n"}},{"id":"srem(key,values:Array(RedisValue))-instance-method","html_id":"srem(key,values:Array(RedisValue))-instance-method","name":"srem","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"args_string":"(key, values : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L731","def":{"name":"srem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command(concat([\"SREM\", key.to_s], values))"}},{"id":"srem(key,*values)-instance-method","html_id":"srem(key,*values)-instance-method","name":"srem","doc":"Remove the specified members from the set stored at key.\n\n**Return value**: Integer, The number of members that were removed from the set, not including non existing members.\n\nExample:\n\n```\nredis.srem(\"myset\", \"Hello\")\n```","summary":"

    Remove the specified members from the set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"args_string":"(key, *values)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L727","def":{"name":"srem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"values","doc":null,"default_value":"","external_name":"values","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"srem(key, values.to_a)"}},{"id":"sscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"sscan(key,cursor,match=nil,count=nil)-instance-method","name":"sscan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array(String), a list of Set members.\n\nExample:\n\n```\nredis.sscan(\"myset\", 0)\nredis.sscan(\"myset\", 0, \"foo*\")\nredis.sscan(\"myset\", 0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L849","def":{"name":"sscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"SSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"strlen(key)-instance-method","html_id":"strlen(key)-instance-method","name":"strlen","doc":"Returns the length of the string value stored at key.\n\n**Return value**: Integer, the length of the string at key, or 0 when key does not exist.","summary":"

    Returns the length of the string value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L373","def":{"name":"strlen","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"STRLEN\", key.to_s])"}},{"id":"subscribe(channels:Array(String)):Void-instance-method","html_id":"subscribe(channels:Array(String)):Void-instance-method","name":"subscribe","doc":"Subscribes to more channels while already being in a subscription loop.","summary":"

    Subscribes to more channels while already being in a subscription loop.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"Array(String)"}],"args_string":"(channels : Array(String)) : Void","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1648","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Void","visibility":"Public","body":"if already_in_subscription_loop?\nelse\n raise(Redis::Error.new(\"Must call subscribe with a subscription block\"))\nend\nvoid_command(concat([\"SUBSCRIBE\"], channels))\n"}},{"id":"subscribe(*channels:String)-instance-method","html_id":"subscribe(*channels:String)-instance-method","name":"subscribe","doc":"Subscribes to more channels while already being in a subscription loop.","summary":"

    Subscribes to more channels while already being in a subscription loop.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"String"}],"args_string":"(*channels : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1658","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"subscribe(channels.to_a)"}},{"id":"subscribe(*channels,&callback_setup_block:Subscription->)-instance-method","html_id":"subscribe(*channels,&callback_setup_block:Subscription->)-instance-method","name":"subscribe","doc":"Subscribes to channels and enters a subscription loop, waiting for events.\n\nThe method yields to the given block and passes a Subscription object, on\nwhich you can set your callbacks for the event subscription.\n\nThe subscription loop will end once you unsubscribe.\n\nSee also: `Subscription` class\nSee also: Example `subscribe.cr`\n\nExample:\n\n```\nredis.subscribe(\"mychannel\") do |on|\n on.message do |channel, message|\n puts \"Received message: #{message}\"\n if message == \"goodbye pal\"\n redis.unsubscribe\n end\n end\nend\n```","summary":"

    Subscribes to channels and enters a subscription loop, waiting for events.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels, &callback_setup_block : Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1632","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Subscription -> )"},"return_type":"","visibility":"Public","body":"if already_in_subscription_loop?\n raise(Redis::Error.new(\"Must call subscribe without a subscription block when already inside a subscription loop\"))\nend\nsubscription = Subscription.new\ncallback_setup_block.call(subscription)\n@strategy = Redis::Strategy::SubscriptionLoop.new(connection, subscription)\nsubscribe(*channels)\n"}},{"id":"sunion(keys:Array(String))-instance-method","html_id":"sunion(keys:Array(String))-instance-method","name":"sunion","doc":"Returns the members of the set resulting from the union of all the given sets.\n\n**Return value**: Array(String), with members of the resulting set.","summary":"

    Returns the members of the set resulting from the union of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L859","def":{"name":"sunion","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_array_command(concat([\"SUNION\"], keys))"}},{"id":"sunion(*keys:String)-instance-method","html_id":"sunion(*keys:String)-instance-method","name":"sunion","doc":"Returns the members of the set resulting from the union of all the given sets.\n\n**Return value**: Array(String), with members of the resulting set.","summary":"

    Returns the members of the set resulting from the union of all the given sets.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(*keys : String)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L864","def":{"name":"sunion","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"sunion(keys.to_a)"}},{"id":"sunionstore(destination,keys:Array(String)):Int64-instance-method","html_id":"sunionstore(destination,keys:Array(String)):Int64-instance-method","name":"sunionstore","doc":"This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(destination, keys : Array(String)) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L871","def":{"name":"sunionstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"integer_command(concat([\"SUNIONSTORE\", destination.to_s], keys))"}},{"id":"sunionstore(destination,*keys:String):Int64-instance-method","html_id":"sunionstore(destination,*keys:String):Int64-instance-method","name":"sunionstore","doc":"This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.\n\n**Return value**: Integer, the number of elements in the resulting set.","summary":"

    This command is equal to SUNION, but instead of returning the resulting set, it is stored in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"args_string":"(destination, *keys : String) : Int64","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L876","def":{"name":"sunionstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"String"}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"Int64","visibility":"Public","body":"sunionstore(destination, keys.to_a)"}},{"id":"ttl(key)-instance-method","html_id":"ttl(key)-instance-method","name":"ttl","doc":"Returns the remaining time to live of a key that has a timeout.\n\n**Return value**: Integer: TTL in seconds, or a negative value in order to\nsignal an error (see the description above).","summary":"

    Returns the remaining time to live of a key that has a timeout.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1583","def":{"name":"ttl","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"TTL\", key.to_s])"}},{"id":"type(key)-instance-method","html_id":"type(key)-instance-method","name":"type","doc":"Returns the string representation of the type of the value stored at key.\n\n**Return value**: String, the type of key, or none when key does not exist.\n\nExample:\n\n```\nredis.set(\"foo\", 3)\nredis.type(\"foo\") # => \"string\"\n```","summary":"

    Returns the string representation of the type of the value stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1606","def":{"name":"type","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"TYPE\", key.to_s])"}},{"id":"unsubscribe(channels:Array(String)):Nil-instance-method","html_id":"unsubscribe(channels:Array(String)):Nil-instance-method","name":"unsubscribe","doc":"Unsubscribes the client from the given channels, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given channels, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"Array(String)"}],"args_string":"(channels : Array(String)) : Nil","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1701","def":{"name":"unsubscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"Nil","visibility":"Public","body":"void_command(concat([\"UNSUBSCRIBE\"], channels))"}},{"id":"unsubscribe(*channels)-instance-method","html_id":"unsubscribe(*channels)-instance-method","name":"unsubscribe","doc":"Unsubscribes the client from the given channels, or from all of them if none is given.","summary":"

    Unsubscribes the client from the given channels, or from all of them if none is given.

    ","abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1706","def":{"name":"unsubscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"unsubscribe(channels.to_a)"}},{"id":"unwatch-instance-method","html_id":"unwatch-instance-method","name":"unwatch","doc":"Flushes all the previously watched keys for a transaction.\n\n**Return value**: \"OK\"","summary":"

    Flushes all the previously watched keys for a transaction.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1747","def":{"name":"unwatch","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"UNWATCH\"])"}},{"id":"watch(keys:Array(String))-instance-method","html_id":"watch(keys:Array(String))-instance-method","name":"watch","doc":"Marks the given keys to be watched for conditional execution of a transaction.\n\n**Return value**: \"OK\"","summary":"

    Marks the given keys to be watched for conditional execution of a transaction.

    ","abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"args_string":"(keys : Array(String))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1736","def":{"name":"watch","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array(String)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command(concat([\"WATCH\"], keys))"}},{"id":"watch(*keys)-instance-method","html_id":"watch(*keys)-instance-method","name":"watch","doc":null,"summary":null,"abstract":false,"args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"args_string":"(*keys)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1740","def":{"name":"watch","args":[{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":""}],"double_splat":null,"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"watch(keys.to_a)"}},{"id":"zadd(key,*scores_and_members)-instance-method","html_id":"zadd(key,*scores_and_members)-instance-method","name":"zadd","doc":"Adds all the specified members with the specified scores to the sorted set stored at key.\n\n**Return value**: Integer, the number of elements added to the sorted sets, not including elements already existing for which the score was updated.\n\nExample:\n\n```\nredis.zadd(\"myzset\", 1, \"one\")\nredis.zadd(\"myzset\", 2, \"two\", 3, \"three\")\n```","summary":"

    Adds all the specified members with the specified scores to the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":""}],"args_string":"(key, *scores_and_members)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1116","def":{"name":"zadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":""}],"double_splat":null,"splat_index":1,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if (scores_and_members.size % 2) > 0\n raise(Error.new(\"zadd expects an array of scores mapped to members\"))\nend\ninteger_command(concat([\"ZADD\", key.to_s], scores_and_members))\n"}},{"id":"zadd(key,scores_and_members:Array(RedisValue))-instance-method","html_id":"zadd(key,scores_and_members:Array(RedisValue))-instance-method","name":"zadd","doc":null,"summary":null,"abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":"Array(RedisValue)"}],"args_string":"(key, scores_and_members : Array(RedisValue))","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1124","def":{"name":"zadd","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"scores_and_members","doc":null,"default_value":"","external_name":"scores_and_members","restriction":"Array(RedisValue)"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if (scores_and_members.size % 2) > 0\n raise(Error.new(\"zadd expects an array of scores mapped to members\"))\nend\ninteger_command(concat([\"ZADD\", key.to_s], scores_and_members))\n"}},{"id":"zcard(key)-instance-method","html_id":"zcard(key)-instance-method","name":"zcard","doc":"Returns the sorted set cardinality (number of elements) of the sorted set stored at key.\n\n**Return value**: Integer, the cardinality (number of elements) of the sorted set, or 0 if key does not exist.","summary":"

    Returns the sorted set cardinality (number of elements) of the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"args_string":"(key)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1156","def":{"name":"zcard","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZCARD\", key.to_s])"}},{"id":"zcount(key,min,max)-instance-method","html_id":"zcount(key,min,max)-instance-method","name":"zcount","doc":"Returns the number of elements in the sorted set at key with a score between min and max.\n\n**Return value**: Integer, the number of elements in the specified score range.","summary":"

    Returns the number of elements in the sorted set at key with a score between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1170","def":{"name":"zcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZCOUNT\", key.to_s, min.to_s, max.to_s])"}},{"id":"zincrby(key,increment,member)-instance-method","html_id":"zincrby(key,increment,member)-instance-method","name":"zincrby","doc":"Increments the score of member in the sorted set stored at key by increment.\n\n**Return value**: String, the new score of member (a double precision floating point number represented as String).","summary":"

    Increments the score of member in the sorted set stored at key by increment.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, increment, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1184","def":{"name":"zincrby","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"increment","doc":null,"default_value":"","external_name":"increment","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_command([\"ZINCRBY\", key.to_s, increment.to_s, member.to_s])"}},{"id":"zinterstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","html_id":"zinterstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","name":"zinterstore","doc":"Computes the intersection of numkeys sorted sets given by the specified keys,\nand stores the result in destination.\n\n**Options**:\n\n* weights - nil or Array(String): Using the WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set.\n* aggregate - With the AGGREGATE option, it is possible to specify how the results of the union are aggregated.\n\n**Return value**: Integer, the number of elements in the resulting sorted set at destination.\n\nExample:\n\n```\nredis.zinterstore(\"zset3\", [\"zset1\", \"zset2\"], weights: [2, 3])\n```","summary":"

    Computes the intersection of numkeys sorted sets given by the specified keys, and stores the result in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"args_string":"(destination, keys : Array, weights = nil, aggregate = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1229","def":{"name":"zinterstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"numkeys = keys.size\nq = concat([\"ZINTERSTORE\", destination.to_s, numkeys.to_s], keys)\nif weights\n q << \"WEIGHTS\"\n concat(q, weights)\nend\nif aggregate\n (q << \"AGGREGATE\") << aggregate.to_s\nend\ninteger_command(q)\n"}},{"id":"zlexcount(key,min,max)-instance-method","html_id":"zlexcount(key,min,max)-instance-method","name":"zlexcount","doc":"When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.\n\n**Return value**: Integer, the number of elements in the specified score range.","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns the number of elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1177","def":{"name":"zlexcount","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZLEXCOUNT\", key.to_s, min.to_s, max.to_s])"}},{"id":"zrange(key,start,stop,with_scores=false)-instance-method","html_id":"zrange(key,start,stop,with_scores=false)-instance-method","name":"zrange","doc":"Returns the specified range of elements in the sorted set stored at key.\n\n**Options**:\n\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), list of elements in the specified range (optionally with their scores, in case the with_scores option is true).\n\nExample:\n\n```\nredis.zrange(\"myzset\", 0, -1, with_scores: true) # => [\"one\", \"1\", \"uno\", \"1\", \"two\", \"2\", \"three\", \"3\"]\n```","summary":"

    Returns the specified range of elements in the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, start, stop, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1145","def":{"name":"zrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGE\", key.to_s, start.to_s, stop.to_s]\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrangebylex(key,min,max,limit=nil)-instance-method","html_id":"zrangebylex(key,min,max,limit=nil)-instance-method","name":"zrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command returns all the\nelements in the sorted set at key with a value between min and max.\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n\n**Return value**:","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"args_string":"(key, min, max, limit = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1272","def":{"name":"zrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGEBYLEX\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nstring_array_command(q)\n"}},{"id":"zrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","html_id":"zrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","name":"zrangebyscore","doc":"Returns all the elements in the sorted set at key with a score between\nmax and min (including elements with score equal to max or min).\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified score range (optionally with their scores).","summary":"

    Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, min, max, limit = nil, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1289","def":{"name":"zrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZRANGEBYSCORE\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrank(key,member)-instance-method","html_id":"zrank(key,member)-instance-method","name":"zrank","doc":"Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.\n\n**Return value**:\n* If member exists in the sorted set, Integer: the rank of member.\n* If member does not exist in the sorted set or key does not exist: nil.","summary":"

    Returns the rank of member in the sorted set stored at key, with the scores ordered from low to high.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1200","def":{"name":"zrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"ZRANK\", key.to_s, member.to_s])"}},{"id":"zrem(key,member)-instance-method","html_id":"zrem(key,member)-instance-method","name":"zrem","doc":"Removes the specified members from the sorted set stored at key.\n\n**Return value**: Integer, the number of members removed from the sorted set, not including non existing members.","summary":"

    Removes the specified members from the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1191","def":{"name":"zrem","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREM\", key.to_s, member.to_s])"}},{"id":"zremrangebylex(key,min,max)-instance-method","html_id":"zremrangebylex(key,min,max)-instance-method","name":"zremrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command removes all\nelements in the sorted set stored at key between the lexicographical range\nspecified by min and max.\n\n**Return value**: Integer, the number of elements removed.","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command removes all elements in the sorted set stored at key between the lexicographical range specified by min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"args_string":"(key, min, max)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1359","def":{"name":"zremrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYLEX\", key.to_s, min.to_s, max.to_s])"}},{"id":"zremrangebyrank(key,start,stop)-instance-method","html_id":"zremrangebyrank(key,start,stop)-instance-method","name":"zremrangebyrank","doc":"Removes all elements in the sorted set stored at key with rank between start and stop.\n\n**Return value**: Integer, the number of elements removed.","summary":"

    Removes all elements in the sorted set stored at key with rank between start and stop.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1366","def":{"name":"zremrangebyrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYRANK\", key.to_s, start.to_s, stop.to_s])"}},{"id":"zremrangebyscore(key,start,stop)-instance-method","html_id":"zremrangebyscore(key,start,stop)-instance-method","name":"zremrangebyscore","doc":"Removes all elements in the sorted set stored at key with a score\nbetween min and max (inclusive).\n\n**Return value**: Integer, the number of elements removed.","summary":"

    Removes all elements in the sorted set stored at key with a score between min and max (inclusive).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"args_string":"(key, start, stop)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1374","def":{"name":"zremrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_command([\"ZREMRANGEBYSCORE\", key.to_s, start.to_s, stop.to_s])"}},{"id":"zrevrange(key,start,stop,with_scores=false)-instance-method","html_id":"zrevrange(key,start,stop,with_scores=false)-instance-method","name":"zrevrange","doc":"Returns the specified range of elements in the sorted set stored at key.\n\n**Options**:\n\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified range (optionally with their scores, in case the with_scores option is true).","summary":"

    Returns the specified range of elements in the sorted set stored at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, start, stop, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1307","def":{"name":"zrevrange","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"start","doc":null,"default_value":"","external_name":"start","restriction":""},{"name":"stop","doc":null,"default_value":"","external_name":"stop","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGE\", key.to_s, start.to_s, stop.to_s]\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrevrangebylex(key,min,max,limit=nil)-instance-method","html_id":"zrevrangebylex(key,min,max,limit=nil)-instance-method","name":"zrevrangebylex","doc":"When all the elements in a sorted set are inserted with the same score,\nin order to force lexicographical ordering, this command returns all the\nelements in the sorted set at key with a value between min and max.\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n\n**Return value**:","summary":"

    When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at key with a value between min and max.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"args_string":"(key, min, max, limit = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1325","def":{"name":"zrevrangebylex","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGEBYLEX\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nstring_array_command(q)\n"}},{"id":"zrevrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","html_id":"zrevrangebyscore(key,min,max,limit=nil,with_scores=false)-instance-method","name":"zrevrangebyscore","doc":"Returns all the elements in the sorted set at key with a score between\nmax and min (including elements with score equal to max or min).\n\n**Options**:\n\n* limit - an array of [offset, count]. Skip offset members, return a maximum of count members.\n* with_scores - true to return the scores of the elements together with the elements.\n\n**Return value**: Array(String), the list of elements in the specified score range (optionally with their scores).","summary":"

    Returns all the elements in the sorted set at key with a score between max and min (including elements with score equal to max or min).

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"args_string":"(key, min, max, limit = nil, with_scores = false)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1342","def":{"name":"zrevrangebyscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"min","doc":null,"default_value":"","external_name":"min","restriction":""},{"name":"max","doc":null,"default_value":"","external_name":"max","restriction":""},{"name":"limit","doc":null,"default_value":"nil","external_name":"limit","restriction":""},{"name":"with_scores","doc":null,"default_value":"false","external_name":"with_scores","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZREVRANGEBYSCORE\", key.to_s, min.to_s, max.to_s]\nif limit\n ((q << \"LIMIT\") << limit[0].to_s) << limit[1].to_s\nend\nif with_scores\n q << \"WITHSCORES\"\nend\nstring_array_command(q)\n"}},{"id":"zrevrank(key,member)-instance-method","html_id":"zrevrank(key,member)-instance-method","name":"zrevrank","doc":"Returns the rank of member in the sorted set stored at key,\nwith the scores ordered from high to low.\n\n**Return value**:\n* If member exists in the sorted set, Integer: the rank of member.\n* If member does not exist in the sorted set or key does not exist: nil.","summary":"

    Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1210","def":{"name":"zrevrank","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"integer_or_nil_command([\"ZREVRANK\", key.to_s, member.to_s])"}},{"id":"zscan(key,cursor,match=nil,count=nil)-instance-method","html_id":"zscan(key,cursor,match=nil,count=nil)-instance-method","name":"zscan","doc":"The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.\n\n**Options**:\n\n* match - It is possible to only iterate elements matching a given glob-style pattern, similarly to the behavior of the KEYS command that takes a pattern as only argument.\n* count - While SCAN does not provide guarantees about the number of elements returned at every iteration, it is possible to empirically adjust the behavior of SCAN using the COUNT option.\n\n**Return value**: Array(String), contains two elements, a member and its associated score, for every returned element of the sorted set.\n\nExample:\n\n```\nredis.zscan(\"myzset\", 0)\nredis.zscan(\"myzset\", 0, \"foo*\")\nredis.zscan(\"myzset\", 0, \"foo*\", 1024)\n```","summary":"

    The SCAN command and the closely related commands SSCAN, HSCAN and ZSCAN are used in order to incrementally iterate over a collection of elements.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"args_string":"(key, cursor, match = nil, count = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1394","def":{"name":"zscan","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"cursor","doc":null,"default_value":"","external_name":"cursor","restriction":""},{"name":"match","doc":null,"default_value":"nil","external_name":"match","restriction":""},{"name":"count","doc":null,"default_value":"nil","external_name":"count","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"q = [\"ZSCAN\", key.to_s, cursor.to_s]\nif match\n (q << \"MATCH\") << match.to_s\nend\nif count\n (q << \"COUNT\") << count.to_s\nend\nstring_array_command(q)\n"}},{"id":"zscore(key,member)-instance-method","html_id":"zscore(key,member)-instance-method","name":"zscore","doc":"Returns the score of member in the sorted set at key.\n\n**Return value**: String, the score of member (a double precision floating point number).","summary":"

    Returns the score of member in the sorted set at key.

    ","abstract":false,"args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"args_string":"(key, member)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1163","def":{"name":"zscore","args":[{"name":"key","doc":null,"default_value":"","external_name":"key","restriction":""},{"name":"member","doc":null,"default_value":"","external_name":"member","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"string_or_nil_command([\"ZSCORE\", key.to_s, member.to_s])"}},{"id":"zunionstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","html_id":"zunionstore(destination,keys:Array,weights=nil,aggregate=nil)-instance-method","name":"zunionstore","doc":"Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.\n\n**Options**:\n\n* weights - nil or Array(String): Using the WEIGHTS option, it is possible to specify a multiplication factor for each input sorted set.\n* aggregate - With the AGGREGATE option, it is possible to specify how the results of the union are aggregated.\n\n**Return value**: Integer, the number of elements in the resulting sorted set at destination.","summary":"

    Computes the union of numkeys sorted sets given by the specified keys, and stores the result in destination.

    ","abstract":false,"args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"args_string":"(destination, keys : Array, weights = nil, aggregate = nil)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/commands.cr#L1250","def":{"name":"zunionstore","args":[{"name":"destination","doc":null,"default_value":"","external_name":"destination","restriction":""},{"name":"keys","doc":null,"default_value":"","external_name":"keys","restriction":"Array"},{"name":"weights","doc":null,"default_value":"nil","external_name":"weights","restriction":""},{"name":"aggregate","doc":null,"default_value":"nil","external_name":"aggregate","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"numkeys = keys.size\nq = concat([\"ZUNIONSTORE\", destination.to_s, numkeys.to_s], keys)\nif weights\n q << \"WEIGHTS\"\n concat(q, weights)\nend\nif aggregate\n (q << \"AGGREGATE\") << aggregate.to_s\nend\ninteger_command(q)\n"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandTimeoutError","path":"Redis/CommandTimeoutError.html","kind":"class","full_name":"Redis::CommandTimeoutError","name":"CommandTimeoutError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":18,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when the `command_timeout` option triggers - a command took too long because the Redis-server is blocked by another command or by a dump.","summary":"

    Raised when the command_timeout option triggers - a command took too long because the Redis-server is blocked by another command or by a dump.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","path":"Redis/ConnectionError.html","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":6,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CannotConnectError","kind":"class","full_name":"Redis::CannotConnectError","name":"CannotConnectError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionLostError","kind":"class","full_name":"Redis::ConnectionLostError","name":"ConnectionLostError"}],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"An error that makes the connection unusable.","summary":"

    An error that makes the connection unusable.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionLostError","path":"Redis/ConnectionLostError.html","kind":"class","full_name":"Redis::ConnectionLostError","name":"ConnectionLostError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":14,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when the connection to the Redis server is lost.","summary":"

    Raised when the connection to the Redis server is lost.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","path":"Redis/Error.html","kind":"class","full_name":"Redis::Error","name":"Error","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":2,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandTimeoutError","kind":"class","full_name":"Redis::CommandTimeoutError","name":"CommandTimeoutError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/ConnectionError","kind":"class","full_name":"Redis::ConnectionError","name":"ConnectionError"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PoolTimeoutError","kind":"class","full_name":"Redis::PoolTimeoutError","name":"PoolTimeoutError"}],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Exception for errors raised by this shard.","summary":"

    Exception for errors raised by this shard.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Future","path":"Redis/Future.html","kind":"class","full_name":"Redis::Future","name":"Future","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/future.cr","line_number":6,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/future.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Futures are handles for values that will become available at a later point in time.\n\nThe API methods Redis#pipelined and Redis#multi make commands return futures instead of actual values.\n\nSee this [example](https://github.com/stefanwille/crystal-redis-examples/blob/master/src/pipelining.cr).","summary":"

    Futures are handles for values that will become available at a later point in time.

    ","class_methods":[],"constructors":[{"id":"new-class-method","html_id":"new-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/future.cr#L9","def":{"name":"new","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"value-instance-method","html_id":"value-instance-method","name":"value","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/future.cr#L14","def":{"name":"value","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"if @ready\n @value\nelse\n raise(Redis::Error.new(\"Future value not ready yet\"))\nend"}},{"id":"value=(new_value)-instance-method","html_id":"value=(new_value)-instance-method","name":"value=","doc":null,"summary":null,"abstract":false,"args":[{"name":"new_value","doc":null,"default_value":"","external_name":"new_value","restriction":""}],"args_string":"(new_value)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/future.cr#L22","def":{"name":"value=","args":[{"name":"new_value","doc":null,"default_value":"","external_name":"new_value","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@value = new_value\n@ready = true\n"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PipelineApi","path":"Redis/PipelineApi.html","kind":"class","full_name":"Redis::PipelineApi","name":"PipelineApi","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/pipeline_api.cr","line_number":18,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pipeline_api.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"API for sending commands in pipelined mode.\n\nUsed in Redis#pipelined.\n\nExample:\n\n```\nredis.pipelined do |pipeline|\n pipeline.set(\"foo1\", \"first\")\n pipeline.set(\"foo2\", \"second\")\nend\n```\n\nIn this example, the `pipeline` object passed to the block is a PipelineApi\nobject.","summary":"

    API for sending commands in pipelined mode.

    ","class_methods":[],"constructors":[{"id":"new(strategy)-class-method","html_id":"new(strategy)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"args_string":"(strategy)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pipeline_api.cr#L21","def":{"name":"new","args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(strategy)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PooledClient","path":"Redis/PooledClient.html","kind":"class","full_name":"Redis::PooledClient","name":"PooledClient","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/pooled_client.cr","line_number":20,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"A Redis client object that can be shared across multiple fibers.\nIt is backed by a connection pool of `Redis` instances and will automatically allocate and free these instances from/to the pool, per command.\n\nExample usage:\n\n```Crystal\nredis = Redis::PooledClient.new(host: ..., port: ..., ..., pool_size: 5)\n10.times do |i|\n spawn do\n redis.set(\"foo#{i}\", \"bar\")\n redis.get(\"foo#{i}\") # => \"bar\"\n end\nend\n```\n\nHere 10 fibers access the same `Redis::PooledClient` instance while automatically sharing 5 Redis connections.\n","summary":"

    A Redis client object that can be shared across multiple fibers.

    ","class_methods":[],"constructors":[{"id":"new(*args,pool_size=5,pool_timeout=5.0,**args2)-class-method","html_id":"new(*args,pool_size=5,pool_timeout=5.0,**args2)-class-method","name":"new","doc":"Accepts the same connection parameters like a `Redis` instance, plus the documented ones.\n\n* pool_size - the number of `Redis` to hold in the connection pool.\n* pool_timeout - the time to wait for a `Redis` instance to become available from the pool before dying with `Redis::PoolTimeoutError`.","summary":"

    Accepts the same connection parameters like a Redis instance, plus the documented ones.

    ","abstract":false,"args":[{"name":"args","doc":null,"default_value":"","external_name":"args","restriction":""},{"name":"pool_size","doc":null,"default_value":"5","external_name":"pool_size","restriction":""},{"name":"pool_timeout","doc":null,"default_value":"5.0","external_name":"pool_timeout","restriction":""}],"args_string":"(*args, pool_size = 5, pool_timeout = 5.0, **args2)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr#L29","def":{"name":"new","args":[{"name":"args","doc":null,"default_value":"","external_name":"args","restriction":""},{"name":"pool_size","doc":null,"default_value":"5","external_name":"pool_size","restriction":""},{"name":"pool_timeout","doc":null,"default_value":"5.0","external_name":"pool_timeout","restriction":""}],"double_splat":{"name":"args2","doc":null,"default_value":"","external_name":"args2","restriction":""},"splat_index":0,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(*args, **args2, pool_size: pool_size, pool_timeout: pool_timeout)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"pool:ConnectionPool(Redis)-instance-method","html_id":"pool:ConnectionPool(Redis)-instance-method","name":"pool","doc":"The connection pool.\nSee [https://github.com/ysbaddaden/pool](https://github.com/ysbaddaden/pool)","summary":"

    The connection pool.

    ","abstract":false,"args":[],"args_string":" : ConnectionPool(Redis)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr#L23","def":{"name":"pool","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@pool"}},{"id":"psubscribe(*channel_patterns,&callback_setup_block:Redis::Subscription->)-instance-method","html_id":"psubscribe(*channel_patterns,&callback_setup_block:Redis::Subscription->)-instance-method","name":"psubscribe","doc":null,"summary":null,"abstract":false,"args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"args_string":"(*channel_patterns, &callback_setup_block : Redis::Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr#L59","def":{"name":"psubscribe","args":[{"name":"channel_patterns","doc":null,"default_value":"","external_name":"channel_patterns","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Redis::Subscription -> )"},"return_type":"","visibility":"Public","body":"with_pool_connection(&.psubscribe(*channel_patterns) do |s|\n callback_setup_block.call(s)\nend)"}},{"id":"subscribe(*channels,&callback_setup_block:Redis::Subscription->)-instance-method","html_id":"subscribe(*channels,&callback_setup_block:Redis::Subscription->)-instance-method","name":"subscribe","doc":null,"summary":null,"abstract":false,"args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"args_string":"(*channels, &callback_setup_block : Redis::Subscription -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr#L55","def":{"name":"subscribe","args":[{"name":"channels","doc":null,"default_value":"","external_name":"channels","restriction":""}],"double_splat":null,"splat_index":0,"yields":1,"block_arg":{"name":"callback_setup_block","doc":null,"default_value":"","external_name":"callback_setup_block","restriction":"(Redis::Subscription -> )"},"return_type":"","visibility":"Public","body":"with_pool_connection(&.subscribe(*channels) do |s|\n callback_setup_block.call(s)\nend)"}}],"macros":[{"id":"method_missing(call)-macro","html_id":"method_missing(call)-macro","name":"method_missing","doc":null,"summary":null,"abstract":false,"args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"args_string":"(call)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/pooled_client.cr#L35","def":{"name":"method_missing","args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"double_splat":null,"splat_index":null,"block_arg":null,"visibility":"Public","body":" \n# Delegates all Redis commands to a `Redis` instance from the connection pool.\n\n with_pool_connection \n{ |conn| conn.\n{{ call }}\n }\n \n"}}],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/PoolTimeoutError","path":"Redis/PoolTimeoutError.html","kind":"class","full_name":"Redis::PoolTimeoutError","name":"PoolTimeoutError","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/Error","kind":"class","full_name":"Redis::Error","name":"Error"},{"html_id":"github.com/stefanwille/crystal-redis/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/error.cr","line_number":22,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/error.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Raised when no free connection became available in the pool within a certain time.","summary":"

    Raised when no free connection became available in the pool within a certain time.

    ","class_methods":[],"constructors":[],"instance_methods":[],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/SocketWrapper","path":"Redis/SocketWrapper.html","kind":"struct","full_name":"Redis::SocketWrapper","name":"SocketWrapper","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Struct","kind":"struct","full_name":"Struct","name":"Struct"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Struct","kind":"struct","full_name":"Struct","name":"Struct"},{"html_id":"github.com/stefanwille/crystal-redis/Value","kind":"struct","full_name":"Value","name":"Value"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/socket_wrapper.cr","line_number":4,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/socket_wrapper.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Wraps an open socket connection.\n\nThe purpose is to be able to convert all exceptions to Redis:Error's.","summary":"

    Wraps an open socket connection.

    ","class_methods":[],"constructors":[{"id":"new(socket:TCPSocket|UNIXSocket|OpenSSL::SSL::Socket::Client)-class-method","html_id":"new(socket:TCPSocket|UNIXSocket|OpenSSL::SSL::Socket::Client)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"socket","doc":null,"default_value":"","external_name":"socket","restriction":"TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client"}],"args_string":"(socket : TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/socket_wrapper.cr#L5","def":{"name":"new","args":[{"name":"socket","doc":null,"default_value":"","external_name":"socket","restriction":"TCPSocket | UNIXSocket | OpenSSL::SSL::Socket::Client"}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(socket)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}},{"id":"new(&block)-class-method","html_id":"new(&block)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"(&block)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/socket_wrapper.cr#L9","def":{"name":"new","args":[],"double_splat":null,"splat_index":null,"yields":0,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n self.new(yield)\nrescue ex : IO::Timeout | Errno | Socket::Error | OpenSSL::Error\n raise(Redis::CannotConnectError.new(\"#{ex.class}: #{ex.message}\"))\nend"}}],"instance_methods":[{"id":"close-instance-method","html_id":"close-instance-method","name":"close","doc":null,"summary":null,"abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/socket_wrapper.cr#L27","def":{"name":"close","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"begin\n if @connected\n @connected = false\n @socket.close\n end\nrescue Errno\nend"}}],"macros":[{"id":"method_missing(call)-macro","html_id":"method_missing(call)-macro","name":"method_missing","doc":null,"summary":null,"abstract":false,"args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"args_string":"(call)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/socket_wrapper.cr#L15","def":{"name":"method_missing","args":[{"name":"call","doc":null,"default_value":"","external_name":"call","restriction":""}],"double_splat":null,"splat_index":null,"block_arg":null,"visibility":"Public","body":" catch_errors \n{ @socket.\n{{ call }}\n }\n \n"}}],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Subscription","path":"Redis/Subscription.html","kind":"class","full_name":"Redis::Subscription","name":"Subscription","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/subscription.cr","line_number":5,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"Models a subscription to one or more publish/subscribe channels.\n\nThe caller sets callbacks on this object that the Redis client will\ntrigger for the matching events.","summary":"

    Models a subscription to one or more publish/subscribe channels.

    ","class_methods":[],"constructors":[],"instance_methods":[{"id":"message(&message_callback:String,String->)-instance-method","html_id":"message(&message_callback:String,String->)-instance-method","name":"message","doc":"Sets the 'message' callback.","summary":"

    Sets the 'message' callback.

    ","abstract":false,"args":[],"args_string":"(&message_callback : String, String -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L28","def":{"name":"message","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"message_callback","doc":null,"default_value":"","external_name":"message_callback","restriction":"(String, String -> )"},"return_type":"","visibility":"Public","body":"@message_callback = message_callback"}},{"id":"pmessage(&pmessage_callback:String,String,String->)-instance-method","html_id":"pmessage(&pmessage_callback:String,String,String->)-instance-method","name":"pmessage","doc":"Sets the 'pmessage' callback.","summary":"

    Sets the 'pmessage' callback.

    ","abstract":false,"args":[],"args_string":"(&pmessage_callback : String, String, String -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L32","def":{"name":"pmessage","args":[],"double_splat":null,"splat_index":null,"yields":3,"block_arg":{"name":"pmessage_callback","doc":null,"default_value":"","external_name":"pmessage_callback","restriction":"(String, String, String -> )"},"return_type":"","visibility":"Public","body":"@pmessage_callback = pmessage_callback"}},{"id":"psubscribe(&psubscribe_callback:String,Int64->)-instance-method","html_id":"psubscribe(&psubscribe_callback:String,Int64->)-instance-method","name":"psubscribe","doc":"Sets the 'psubscribe' callback.","summary":"

    Sets the 'psubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&psubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L24","def":{"name":"psubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"psubscribe_callback","doc":null,"default_value":"","external_name":"psubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@psubscribe_callback = psubscribe_callback"}},{"id":"punsubscribe(&punsubscribe_callback:String,Int64->)-instance-method","html_id":"punsubscribe(&punsubscribe_callback:String,Int64->)-instance-method","name":"punsubscribe","doc":"Sets the 'punsubscribe' callback.","summary":"

    Sets the 'punsubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&punsubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L40","def":{"name":"punsubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"punsubscribe_callback","doc":null,"default_value":"","external_name":"punsubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@punsubscribe_callback = punsubscribe_callback"}},{"id":"subscribe(&subscribe_callback:String,Int64->)-instance-method","html_id":"subscribe(&subscribe_callback:String,Int64->)-instance-method","name":"subscribe","doc":"Sets the 'subscribe' callback.","summary":"

    Sets the 'subscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&subscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L20","def":{"name":"subscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"subscribe_callback","doc":null,"default_value":"","external_name":"subscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@subscribe_callback = subscribe_callback"}},{"id":"unsubscribe(&unsubscribe_callback:String,Int64->)-instance-method","html_id":"unsubscribe(&unsubscribe_callback:String,Int64->)-instance-method","name":"unsubscribe","doc":"Sets the 'unsubscribe' callback.","summary":"

    Sets the 'unsubscribe' callback.

    ","abstract":false,"args":[],"args_string":"(&unsubscribe_callback : String, Int64 -> )","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/subscription.cr#L36","def":{"name":"unsubscribe","args":[],"double_splat":null,"splat_index":null,"yields":2,"block_arg":{"name":"unsubscribe_callback","doc":null,"default_value":"","external_name":"unsubscribe_callback","restriction":"(String, Int64 -> )"},"return_type":"","visibility":"Public","body":"@unsubscribe_callback = unsubscribe_callback"}}],"macros":[],"types":[]},{"html_id":"github.com/stefanwille/crystal-redis/Redis/TransactionApi","path":"Redis/TransactionApi.html","kind":"class","full_name":"Redis::TransactionApi","name":"TransactionApi","abstract":false,"superclass":{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},"ancestors":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"},{"html_id":"github.com/stefanwille/crystal-redis/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"github.com/stefanwille/crystal-redis/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"redis/transaction_api.cr","line_number":19,"url":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/transaction_api.cr"}],"repository_name":"github.com/stefanwille/crystal-redis","program":false,"enum":false,"alias":false,"aliased":"","const":false,"constants":[],"included_modules":[{"html_id":"github.com/stefanwille/crystal-redis/Redis/CommandExecution/FutureOriented","kind":"module","full_name":"Redis::CommandExecution::FutureOriented","name":"FutureOriented"},{"html_id":"github.com/stefanwille/crystal-redis/Redis/Commands","kind":"module","full_name":"Redis::Commands","name":"Commands"}],"extended_modules":[],"subclasses":[],"including_types":[],"namespace":{"html_id":"github.com/stefanwille/crystal-redis/Redis","kind":"class","full_name":"Redis","name":"Redis"},"doc":"API for sending commands in a transaction.\n\nUsed in Redis#multi.\n\n\nExample:\n\n```\nredis.multi do |multi|\n multi.set(\"foo1\", \"first\")\n multi.set(\"foo2\", \"second\")\nend\n```\n\nIn this example, the `multi` object passed to the block is a TransactionApi\nobject.","summary":"

    API for sending commands in a transaction.

    ","class_methods":[],"constructors":[{"id":"new(strategy)-class-method","html_id":"new(strategy)-class-method","name":"new","doc":null,"summary":null,"abstract":false,"args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"args_string":"(strategy)","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/transaction_api.cr#L22","def":{"name":"new","args":[{"name":"strategy","doc":null,"default_value":"","external_name":"strategy","restriction":""}],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"_ = allocate\n_.initialize(strategy)\nif _.responds_to?(:finalize)\n ::GC.add_finalizer(_)\nend\n_\n"}}],"instance_methods":[{"id":"discard-instance-method","html_id":"discard-instance-method","name":"discard","doc":"Aborts the current transaction.\n\n**Example**:\n\n```\nredis.multi do |multi|\n multi.set(\"foo\", \"the new value\")\n multi.discard\nend\n```","summary":"

    Aborts the current transaction.

    ","abstract":false,"args":[],"args_string":"","source_link":"https://github.com/stefanwille/crystal-redis/blob/ef8cf5321123c3794933501b98c8a26175ce4053/src/redis/transaction_api.cr#L39","def":{"name":"discard","args":[],"double_splat":null,"splat_index":null,"yields":null,"block_arg":null,"return_type":"","visibility":"Public","body":"@strategy.discard"}}],"macros":[],"types":[]}]}]}}) \ No newline at end of file diff --git a/shard.yml b/shard.yml index abdcb17..25754fb 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: redis -version: 2.2.1 +version: 2.3.0 authors: - Stefan Wille