class Client extends BaseClient with NormalCommands with SubscribeCommands with Transactions
- Alphabetic
- By Inheritance
- Client
- Transactions
- SubscribeCommands
- NormalCommands
- StreamCommands
- ConnectionCommands
- BasicConnectionCommands
- ScriptCommands
- ServerCommands
- BasicServerCommands
- PubSubCommands
- GeoCommands
- HyperLogLogCommands
- TopologyCommands
- BtreeSortedSetCommands
- SetCommands
- ListCommands
- SortedSetCommands
- HashCommands
- StringCommands
- KeyCommands
- BaseClient
- Closable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Client(factory: ServiceFactory[Command, Reply], timer: Timer = DefaultTimer)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val FutureFalse: Future[Boolean]
- Definition Classes
- StringCommands
- val FutureTrue: Future[Boolean]
- Definition Classes
- StringCommands
- def append(key: Buf, value: Buf): Future[Long]
Appends value at the given key.
Appends value at the given key. If key doesn't exist, behavior is similar to SET command
- returns
length of string after append operation
- Definition Classes
- StringCommands
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def auth(password: Buf): Future[Unit]
Authorizes to db
Authorizes to db
- Definition Classes
- ConnectionCommands
- def bAdd(key: Buf, field: Buf, value: Buf): Future[Long]
Sets
field
:value
pair in the given btree sorted setkey
.Sets
field
:value
pair in the given btree sorted setkey
.- returns
1 if field is new, 0 if field was updated.
- Definition Classes
- BtreeSortedSetCommands
- def bCard(key: Buf): Future[Long]
Returns the btree sorted set cardinality for the given
key
.Returns the btree sorted set cardinality for the given
key
. Returns 0 if key does not exist.- Definition Classes
- BtreeSortedSetCommands
- def bGet(key: Buf, field: Buf): Future[Option[Buf]]
Gets the value for the
field
from the given btree sorted setkey
.Gets the value for the
field
from the given btree sorted setkey
.- returns
Some
if the field exists,None
otherwise.
- Definition Classes
- BtreeSortedSetCommands
- def bMergeEx(key: Buf, fv: Map[Buf, Buf], milliseconds: Long): Future[Unit]
- Definition Classes
- BtreeSortedSetCommands
- def bRange(key: Buf, count: Int, startField: Option[Buf], endField: Option[Buf]): Future[Seq[(Buf, Buf)]]
Gets all field value pairs for the given btree sorted order
key
fromstartField
toendField
.Gets all field value pairs for the given btree sorted order
key
fromstartField
toendField
.- Definition Classes
- BtreeSortedSetCommands
- def bRem(key: Buf, fields: Seq[Buf]): Future[Long]
Deletes
fields
from the given btree sorted setkey
.Deletes
fields
from the given btree sorted setkey
.- returns
The number of fields deleted.
- Definition Classes
- BtreeSortedSetCommands
- def bitCount(key: Buf, start: Option[Int], end: Option[Int]): Future[Long]
- Definition Classes
- StringCommands
- def bitCount(key: Buf): Future[Long]
- Definition Classes
- StringCommands
- def bitOp(op: Buf, dstKey: Buf, srcKeys: Seq[Buf]): Future[Long]
- Definition Classes
- StringCommands
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(deadline: Time): Future[Unit]
Releases underlying service factory object
Releases underlying service factory object
- Definition Classes
- BaseClient → Closable
- def close(after: Duration): Future[Unit]
- Definition Classes
- Closable
- final def close(): Future[Unit]
- Definition Classes
- Closable
- def dbSize(): Future[Long]
- Definition Classes
- ServerCommands
- def decr(key: Buf): Future[Long]
Decrements number stored at key by 1.
Decrements number stored at key by 1.
- returns
value after decrement.
- Definition Classes
- StringCommands
- def decrBy(key: Buf, amount: Long): Future[Long]
Decrements number stored at key by given amount.
Decrements number stored at key by given amount. If key doesn't exist, value is set to 0 before the operation
- returns
value after decrement. Error if key contains value of the wrong type
- Definition Classes
- StringCommands
- def dels(keys: Seq[Buf]): Future[Long]
Removes keys
Removes keys
- keys
list of keys to remove
- returns
Number of keys removed
- Definition Classes
- KeyCommands
- def dump(key: Buf): Future[Option[Buf]]
Serialize the value stored at key in a Redis-specific format and returns it to the user
Serialize the value stored at key in a Redis-specific format and returns it to the user
- returns
bytes, or none if the key did not exist
- Definition Classes
- KeyCommands
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def eval(script: Buf, keys: Seq[Buf], argv: Seq[Buf]): Future[Reply]
Executes EVAL command returns the raw redis-server Reply.
Executes EVAL command returns the raw redis-server Reply.
User may convert this Reply to type T by calling their Scripts.castReply[T](reply), or "reply.cast[T]" which is an implicit conversion through Scripts.CastableReply helper class.
An idiomatic usage:
import Scripts._ client.eval(script, keys, argv).map { _.cast[Long] }
returns a Future[Long], and is equivalent to
client.eval(script, keys, argv).map(Scripts.castReply[Long])
- script
the script to execute
- keys
the redis keys that the script may have access to
- argv
the array of arguments that the script takes
- returns
redis-server Reply
- Definition Classes
- ScriptCommands
- def evalSha(sha: Buf, script: Buf, keys: Seq[Buf], argv: Seq[Buf]): Future[Reply]
Executes EVALSHA command, and if redis-server complains about NOSCRIPT, execute EVAL with fallback "script" instead.
Executes EVALSHA command, and if redis-server complains about NOSCRIPT, execute EVAL with fallback "script" instead.
Similar to evalSha, but this takes a fallback "script" parameter in addition to "sha", so that any ErrorReply("NOSCRIPT...") will be silently caught and a corresponding EVAL command will be retried.
- sha
SHA-1 digest of the script to execute
- script
the fallback script. User must guarantee that
sha == SHA1(script)
where "SHA1" computes the SHA-1 digest (as a HEX string) of script.
- keys
the redis keys that the script may have access to
- argv
the array of arguments that the script takes
- returns
redis-server Reply
- Definition Classes
- ScriptCommands
- def evalSha(sha: Buf, keys: Seq[Buf], argv: Seq[Buf]): Future[Reply]
Executes EVALSHA command and returns the raw redis-server Reply.
Executes EVALSHA command and returns the raw redis-server Reply.
Similar to eval, but takes "sha" (SHA-1 digest of a script) as the first parameter. If the script cache on redis-server does not contain a script whose SHA-1 digest is "sha", this will return ErrorReply(message) where message starts with "NOSCRIPT".
- sha
SHA-1 digest of the script to execute
- keys
the redis keys that the script may have access to
- argv
the array of arguments that the script takes
- returns
redis-server Reply
- Definition Classes
- ScriptCommands
- def exists(key: Buf): Future[Boolean]
Checks if given key exists
Checks if given key exists
- returns
true if key exists, false otherwise
- Definition Classes
- KeyCommands
- def expire(key: Buf, ttl: Long): Future[Boolean]
Sets how long it will take the key to expire
Sets how long it will take the key to expire
- returns
boolean, true if it successfully set the ttl (time to live) on a valid key, false otherwise.
- Definition Classes
- KeyCommands
- def expireAt(key: Buf, ttl: Long): Future[Boolean]
Same effect and semantic as "expire", but takes an absolute Unix timestamp
Same effect and semantic as "expire", but takes an absolute Unix timestamp
- ttl
time-to-live as unix timestamp
- returns
boolean, true if it successfully set the ttl (time to live) on a valid key, false otherwise.
- Definition Classes
- KeyCommands
- val factory: ServiceFactory[Command, Reply]
- Definition Classes
- Client → BaseClient
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def flushAll(): Future[Unit]
Deletes all keys in all databases
Deletes all keys in all databases
- Definition Classes
- ServerCommands
- def flushDB(): Future[Unit]
Deletes all keys in current DB
Deletes all keys in current DB
- Definition Classes
- ServerCommands
- def geoAdd(key: Buf, members: GeoMember*): Future[Long]
Adds member -> score pair
members
to sorted set under thekey
.Adds member -> score pair
members
to sorted set under thekey
.- returns
The number of elements added to sorted set.
- Definition Classes
- GeoCommands
- Note
Adding multiple elements only works with redis 2.4 or later.
- def geoDistance(key: Buf, fromMember: Buf, toMember: Buf, distanceUnit: GeoUnit = GeoUnit.Meter): Future[Option[Double]]
- key
the GeoSet to search
- fromMember
the first member in the query
- toMember
the second member in the query
- distanceUnit
the units used for distance
- returns
distance between two GeoSet members
- Definition Classes
- GeoCommands
- def geoHash(key: Buf, members: Buf*): Future[Seq[Option[String]]]
Gets the geohash of
members
in sorted set at thekey
.Gets the geohash of
members
in sorted set at thekey
.https://redis.io/commands/geohash
- key
the GeoSet to search for the member
- members
the GeoSet members whose geo hash we want
- Definition Classes
- GeoCommands
- def geoPosition(key: Buf, members: Buf*): Future[Seq[Option[(Double, Double)]]]
- key
the GeoSet to search
- members
the members to get lat/lon for
- returns
the lon/lat of the queried member
- Definition Classes
- GeoCommands
- def geoRadius(key: Buf, longitude: Double, latitude: Double, radius: Double, unit: GeoUnit, withCoord: Boolean = false, withDist: Boolean = false, withHash: Boolean = false, count: Option[Int] = None, sort: Option[Sort] = None, store: Option[Buf] = None, storeDist: Option[Buf] = None): Future[Seq[Option[GeoRadiusResult]]]
Get the members of a sorted set which are within the borders of the area specified with the center location * and the maximum distance from the center (the radius).
Get the members of a sorted set which are within the borders of the area specified with the center location * and the maximum distance from the center (the radius).
- returns
Future of an array where each member represents element. Each element additionally contains coordinate, distance and geohash if options are specified
- Definition Classes
- GeoCommands
- def geoRadiusByMember(key: Buf, member: Buf, radius: Double, unit: GeoUnit, withCoord: Boolean = false, withDist: Boolean = false, withHash: Boolean = false, count: Option[Int] = None, sort: Option[Sort] = None, store: Option[Buf] = None, storeDist: Option[Buf] = None): Future[Seq[Option[GeoRadiusResult]]]
Get the members of a sorted set which are within the borders of the area specified with the center location of a
member
.Get the members of a sorted set which are within the borders of the area specified with the center location of a
member
.- returns
Future of an array where each member represents element. Each element additionally contains coordinate, distance and geohash if options are specified
- Definition Classes
- GeoCommands
- def geoRem(key: Buf, members: Seq[Buf]): Future[Long]
Geo removal, equivalent to sorted set removal as GeoSets are SortedSets underneath
Geo removal, equivalent to sorted set removal as GeoSets are SortedSets underneath
- key
the GeoSet to remove members from
- members
the members to remove
- returns
the number of members removed from the set
- Definition Classes
- GeoCommands
- def get(key: Buf): Future[Option[Buf]]
Gets the value associated with the given key
Gets the value associated with the given key
- returns
value, or none if key doesn't exist
- Definition Classes
- StringCommands
- def getBit(key: Buf, offset: Int): Future[Long]
Returns the bit value at offset in the string value stored at key.
Returns the bit value at offset in the string value stored at key.
- returns
the bit value stored at offset.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/getbit
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getRange(key: Buf, start: Long, end: Long): Future[Option[Buf]]
Gets the substring of the value associated with given key
Gets the substring of the value associated with given key
- returns
substring, or none if key doesn't exist
- Definition Classes
- StringCommands
- def getSet(key: Buf, value: Buf): Future[Option[Buf]]
Atomically sets key to value and returns the old value stored at key.
Atomically sets key to value and returns the old value stored at key. Returns an error when key exists but does not hold a string value.
- returns
the old value stored at key wrapped in Some, or None when key did not exist.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/getset
- def hDel(key: Buf, fields: Seq[Buf]): Future[Long]
Deletes
fields
from given hashkey
.Deletes
fields
from given hashkey
. Returns the number of fields deleted.- Definition Classes
- HashCommands
- def hExists(key: Buf, field: Buf): Future[Boolean]
Determines if a hash
field
exists on a given hashkey
.Determines if a hash
field
exists on a given hashkey
. Returns boolean signaling whether the field exists.- Definition Classes
- HashCommands
- def hGet(key: Buf, field: Buf): Future[Option[Buf]]
Gets
field
from a given hashkey
.Gets
field
from a given hashkey
.- Definition Classes
- HashCommands
- def hGetAll(key: Buf): Future[Seq[(Buf, Buf)]]
Gets all field value pairs for given hash
key
.Gets all field value pairs for given hash
key
.- Definition Classes
- HashCommands
- def hIncrBy(key: Buf, field: Buf, amount: Long): Future[Long]
Increments a
field
on a given hashkey
byamount
.Increments a
field
on a given hashkey
byamount
. Returns new field value.- Definition Classes
- HashCommands
- def hKeys(key: Buf): Future[Seq[Buf]]
Returns all field names stored at the hash
key
.Returns all field names stored at the hash
key
.- Definition Classes
- HashCommands
- def hLen(key: Buf): Future[Long]
Returns the number of fields stored at the hash
key
.Returns the number of fields stored at the hash
key
.- Definition Classes
- HashCommands
- def hMGet(key: Buf, fields: Seq[Buf]): Future[Seq[Buf]]
Gets values for given fields stored at the hash
key
.Gets values for given fields stored at the hash
key
.- Definition Classes
- HashCommands
- def hMSet(key: Buf, fv: Map[Buf, Buf]): Future[Unit]
Sets values for given fields stored at the hash
key
.Sets values for given fields stored at the hash
key
.- Definition Classes
- HashCommands
- def hMSetEx(key: Buf, fv: Map[Buf, Buf], milliseconds: Long): Future[Unit]
Sets values for given fields stored at the hash
key
and sets the ttl.Sets values for given fields stored at the hash
key
and sets the ttl.- Definition Classes
- HashCommands
- def hMergeEx(key: Buf, fv: Map[Buf, Buf], milliseconds: Long): Future[Unit]
Adds values for given fields stored at the hash
key
if it doesn't exist and sets the ttl.Adds values for given fields stored at the hash
key
if it doesn't exist and sets the ttl. Version set at the destination is retained if it already exists.- Definition Classes
- HashCommands
- def hScan(key: Buf, cursor: Long, count: Option[Long], pattern: Option[Buf]): Future[Seq[Buf]]
Returns keys in given hash
key
, starting atcursor
.Returns keys in given hash
key
, starting atcursor
.- Definition Classes
- HashCommands
- def hSet(key: Buf, field: Buf, value: Buf): Future[Long]
Sets
field
stored at given hashkey
to a givenvalue
.Sets
field
stored at given hashkey
to a givenvalue
. Returns1
if fields is new,0
if field was updated.- Definition Classes
- HashCommands
- def hSetNx(key: Buf, field: Buf, value: Buf): Future[Long]
Sets
field
stored at given hashkey
to a givenvalue
only if the field Returns1
if fields is new,0
no operation was performed.Sets
field
stored at given hashkey
to a givenvalue
only if the field Returns1
if fields is new,0
no operation was performed.- Definition Classes
- HashCommands
- def hStrlen(key: Buf, field: Buf): Future[Long]
- Definition Classes
- HashCommands
- def hVals(key: Buf): Future[Seq[Buf]]
Gets the values of all fields in given hash
key
.Gets the values of all fields in given hash
key
. Returns empty list if key does not exist.- Definition Classes
- HashCommands
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def incr(key: Buf): Future[Long]
Increments the number stored at key by one.
Increments the number stored at key by one.
- returns
the value of key after the increment.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/incr
- def incrBy(key: Buf, increment: Long): Future[Long]
Increments the number stored at key by increment.
Increments the number stored at key by increment.
- returns
the value of key after the increment.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/incrby
- def info(section: Buf): Future[Option[Buf]]
Returns information and statistics about the server
Returns information and statistics about the server
- section
used to select a specific section of information.
- returns
a collection of \r\n terminated lines if server has info on the section
- Definition Classes
- BasicServerCommands
- def info(): Future[Option[Buf]]
Returns information and statistics about the server
Returns information and statistics about the server
- returns
Buf with collection of \r\n terminated lines of the default info section
- Definition Classes
- BasicServerCommands
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def keys(pattern: Buf): Future[Seq[Buf]]
Returns all keys matching pattern
Returns all keys matching pattern
- returns
list of keys matching pattern
- Definition Classes
- KeyCommands
- def lIndex(key: Buf, index: Long): Future[Option[Buf]]
Gets the value of the element at the
index
position in the list stored at the hashkey
.Gets the value of the element at the
index
position in the list stored at the hashkey
. If the key is a non-list element, an exception will be thrown.- returns
Some
if the given element exists,None
otherwise.
- Definition Classes
- ListCommands
- def lInsertAfter(key: Buf, pivot: Buf, value: Buf): Future[Option[Long]]
Inserts a given
value
after anotherpivot
value in the list stored at the hashkey
.Inserts a given
value
after anotherpivot
value in the list stored at the hashkey
. If the key is a non-list element, an exception will be thrown.- returns
Some
of the new length of the list.None
if the pivot is not found, or the list is empty.
- Definition Classes
- ListCommands
- def lInsertBefore(key: Buf, pivot: Buf, value: Buf): Future[Option[Long]]
Inserts a
value
before anotherpivot
value in the list stored at the hashkey
.Inserts a
value
before anotherpivot
value in the list stored at the hashkey
. If the key is a non-list element, an exception will be thrown.- returns
Some
of the new length of the list, orNone
if the pivot is not found, or the list is empty.
- Definition Classes
- ListCommands
- def lLen(key: Buf): Future[Long]
Gets the length of the list stored at the hash
key
.Gets the length of the list stored at the hash
key
. If the key is a non-list element, an exception will be thrown. Unassigned keys are considered empty lists (has size 0).- Definition Classes
- ListCommands
- def lPop(key: Buf): Future[Option[Buf]]
Pops a value off the front of the list stored at the hash
key
.Pops a value off the front of the list stored at the hash
key
. If the key is a non-list element, an exception will be thrown.- returns
Some
of the value of the popped element, orNone
if the list is empty.
- Definition Classes
- ListCommands
- def lPush(key: Buf, values: List[Buf]): Future[Long]
Pushes a list of
value
onto the front of the list stored at the hashkey
.Pushes a list of
value
onto the front of the list stored at the hashkey
. If the key is a non-list element, an exception will be thrown.- returns
The length of the list.
- Definition Classes
- ListCommands
- def lRange(key: Buf, start: Long, end: Long): Future[List[Buf]]
Gets the values in the given range
start
-end
(inclusive) of the list stored at the hashkey
.Gets the values in the given range
start
-end
(inclusive) of the list stored at the hashkey
. If the key is a non-list element, an exception will be thrown.- Definition Classes
- ListCommands
- def lRem(key: Buf, count: Long, value: Buf): Future[Long]
Removes
count
elements matchingvalue
from the list stored at the hashkey
.Removes
count
elements matchingvalue
from the list stored at the hashkey
. If the key is a non-list element, an exception will be thrown.- returns
The number of removed elements.
- Definition Classes
- ListCommands
- Note
The sign of
count
describes whether it will remove them from the back or the front of the list. Ifcount
is 0, it will remove all instances.
- def lReset(key: Buf, values: List[Buf], ttl: Long = -1, trim: Long = -1): Future[Unit]
Creates a list at
key
, pushes givenvalues
onto the end of the list, trims the list totrim
length, and sets the ttl.Creates a list at
key
, pushes givenvalues
onto the end of the list, trims the list totrim
length, and sets the ttl.ttl
andtrim
are not used if set to -1. If a list already exists atkey
, the list will be overwritten. If the key is a non-list element, an exception will be thrown.This command is Twitter-specific. Most Redis implementations do not support this method.
- Definition Classes
- ListCommands
- def lSet(key: Buf, index: Long, value: Buf): Future[Unit]
Sets the element at
index
in the list stored under the hashkey
to a givenvalue
.Sets the element at
index
in the list stored under the hashkey
to a givenvalue
. If the key is a non-list element, an exception will be thrown.- Definition Classes
- ListCommands
- def lTrim(key: Buf, start: Long, end: Long): Future[Unit]
Removes all of the elements from the list stored at hash
key
, except for those in the range:start
-end
(inclusive).Removes all of the elements from the list stored at hash
key
, except for those in the range:start
-end
(inclusive).- Definition Classes
- ListCommands
- def mGet(keys: Seq[Buf]): Future[Seq[Option[Buf]]]
Returns the values of all specified keys.
Returns the values of all specified keys.
- returns
list of values at the specified keys.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/mget
- def mSet(kv: Map[Buf, Buf]): Future[Unit]
Sets the given keys to their respective values.
Sets the given keys to their respective values. MSET replaces existing values with new values, just as regular SET.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/mset
- def mSetNx(kv: Map[Buf, Buf]): Future[Boolean]
Sets the given keys to their respective values.
Sets the given keys to their respective values. MSETNX will not perform any operation at all even if just a single key already exists.
- returns
1 if all keys were set, 0 if no keys were set.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/msetnx
- def migrate(destAddr: InetSocketAddress, keys: Seq[Buf], timeout: Duration = 5.seconds): Future[Unit]
Migrates all keys to the destination server
Migrates all keys to the destination server
- destAddr
target redis server
- keys
list of keys to be migrated
- timeout
timeout before failing, defaults to 5 seconds
- returns
unit
- Definition Classes
- KeyCommands
- def move(key: Buf, db: Buf): Future[Boolean]
Move key from the currently selected database to the specified destination database.
Move key from the currently selected database to the specified destination database. When key already exists in the destination database, or it does not exist in the source database, it does nothing.
- returns
true if key was moved. false if key was not moved for any reason.
- Definition Classes
- KeyCommands
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def pExpire(key: Buf, milliseconds: Long): Future[Boolean]
Set a key's time to live in milliseconds.
Set a key's time to live in milliseconds.
- returns
true if the timeout was set. false if key does not exist or the timeout could not be set.
- Definition Classes
- KeyCommands
- See also
https://redis.io/commands/pexpire
- def pExpireAt(key: Buf, timestamp: Long): Future[Boolean]
Set the expiration for a key as a UNIX timestamp specified in milliseconds.
Set the expiration for a key as a UNIX timestamp specified in milliseconds.
- returns
true if the timeout was set. false if key does not exist or the timeout could not be set (see: EXPIRE).
- Definition Classes
- KeyCommands
- See also
https://redis.io/commands/pexpireat
- def pSetEx(key: Buf, millis: Long, value: Buf): Future[Unit]
Works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.
Works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/psetex
- def pSubscribe(patterns: Seq[Buf])(handler: MessageHandler): Future[Map[Buf, Throwable]]
Subscribe to patterns.
Subscribe to patterns. Messages received from the subscribed patterns will be processed by the handler.
A pattern will be subscribed to only once. Subscribing to an already subscribed pattern will be ignored. Although a Seq is passed in as argument, the patterns are subscribed to one by one, with individual commands, and when the client is connected to multiple server nodes, it is not guaranteed that they are subscribed to from the same node.
When the Future returned by this method is completed, it is guaranteed that an attempt is made, to send a pSubscribe command for each of the patterns that is not subscribed to yet. And the failed subscriptions are returned as a map from the failed channel to the exception object. Subscriptions will be managed by the SubscriptionManager, even if it failed at the first attempt. In that case, subsequent attempts will be made regularly until the pattern is subscribed to successfully, or the subscription is cancelled by calling the pUnsubscribed method.
- Definition Classes
- SubscribeCommands
- def pTtl(key: Buf): Future[Option[Long]]
Get the time to live for a key in milliseconds.
Get the time to live for a key in milliseconds.
- returns
Time to live in milliseconds or None when key does not exist or does not have a timeout.
- Definition Classes
- KeyCommands
- def pUnsubscribe(patterns: Seq[Buf]): Future[Map[Buf, Throwable]]
Unsubscribe from patterns.
Unsubscribe from patterns. The subscriptions to the specified patterns are removed from the SubscriptionManager. An unsubscribe command is sent for each of the succeeded subscriptions, and the failed ones are returned as a Future of map from the pattern to the exception object.
- Definition Classes
- SubscribeCommands
- def persist(key: Buf): Future[Long]
Persist a key by removing it's expiration time
Persist a key by removing it's expiration time
- returns
1 if ttl was removed, 0 if key doesn't exist or doesn't have a ttl
- Definition Classes
- KeyCommands
- def pfAdd(key: Buf, elements: List[Buf]): Future[Boolean]
Adds
elements
to a HyperLogLog data structure stored under hashkey
.Adds
elements
to a HyperLogLog data structure stored under hashkey
.- returns
Whether a bit was set in the HyperLogLog data structure.
- Definition Classes
- HyperLogLogCommands
- See also
https://redis.io/commands/pfadd
- def pfCount(keys: Seq[Buf]): Future[Long]
Gets the approximated cardinality (number of unique elements) of sets observed by the HyperLogLog at
keys
.Gets the approximated cardinality (number of unique elements) of sets observed by the HyperLogLog at
keys
.- Definition Classes
- HyperLogLogCommands
- See also
https://redis.io/commands/pfcount
- def pfMerge(destKey: Buf, srcKeys: Seq[Buf]): Future[Unit]
Merges HyperLogLogs at
srcKeys
to create a new HyperLogLog atdestKey
.Merges HyperLogLogs at
srcKeys
to create a new HyperLogLog atdestKey
.- Definition Classes
- HyperLogLogCommands
- See also
https://redis.io/commands/pfmerge
- def ping(): Future[Unit]
Sends a PING to Redis instance
Sends a PING to Redis instance
- Definition Classes
- BasicConnectionCommands
- def pubSubChannels(pattern: Option[Buf] = None): Future[Seq[Buf]]
Lists the currently active channels.
Lists the currently active channels. An active channel is a Pub/Sub channel with one or more subscribers (not including clients subscribed to patterns).
- Definition Classes
- PubSubCommands
- def pubSubNumPat(): Future[Long]
Returns the number of subscriptions to patterns (that are performed using the PSUBSCRIBE command).
Returns the number of subscriptions to patterns (that are performed using the PSUBSCRIBE command).
- Definition Classes
- PubSubCommands
- def pubSubNumSub(channels: Seq[Buf]): Future[Map[Buf, Long]]
Returns the number of subscribers (not counting clients subscribed to patterns) for the specified
channels
.Returns the number of subscribers (not counting clients subscribed to patterns) for the specified
channels
.- Definition Classes
- PubSubCommands
- def publish(channel: Buf, message: Buf): Future[Long]
Publishes a
message
to the specifiedchannel
.Publishes a
message
to the specifiedchannel
.- Definition Classes
- PubSubCommands
- def quit(): Future[Unit]
Closes connection to Redis instance
Closes connection to Redis instance
- Definition Classes
- BasicConnectionCommands
- def rPop(key: Buf): Future[Option[Buf]]
Pops a value off the end of the list stored at hash
key
.Pops a value off the end of the list stored at hash
key
. If the key is a non-list element, an exception will be thrown.- returns
Some
of the value of the popped element, orNone
if the list is empty.
- Definition Classes
- ListCommands
- def rPopLPush(source: Buf, dest: Buf): Future[Option[Buf]]
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
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
- returns
Some
of the value of the popped element, orNone
if the list is empty.
- Definition Classes
- ListCommands
- def rPush(key: Buf, values: List[Buf]): Future[Long]
Pushes given
values
onto the end of the list stored at the hashkey
.Pushes given
values
onto the end of the list stored at the hashkey
. If the key is a non-list element, an exception will be thrown.- returns
The length of the list.
- Definition Classes
- ListCommands
- def replicaOf(host: Buf, port: Buf): Future[Unit]
- Definition Classes
- ServerCommands
- def sAdd(key: Buf, members: List[Buf]): Future[Long]
Adds
members
to the set stored under thekey
.Adds
members
to the set stored under thekey
. Throws an exception if thekey
does not refer to a set.- returns
The number of new members added to the set.
- Definition Classes
- SetCommands
- def sCard(key: Buf): Future[Long]
Returns the size of the set stored under the
key
.Returns the size of the set stored under the
key
. Throws an exception if the key does not refer to a set.Unassigned keys are considered empty sets.
- Definition Classes
- SetCommands
- def sInter(keys: Seq[Buf]): Future[Set[Buf]]
Returns the members of the set resulting from the intersection of all the sets stored under
keys
.Returns the members of the set resulting from the intersection of all the sets stored under
keys
.Keys that do not exist are considered to be empty sets. With one of the keys being an empty set, the resulting set is also empty (since set intersection with an empty set always results in an empty set).
Throws an exception if the
keys
Seq is empty or if any of the keys passed as params are empty.- Definition Classes
- SetCommands
- def sIsMember(key: Buf, member: Buf): Future[Boolean]
Checks if the given
member
exists in a set stored under thekey
.Checks if the given
member
exists in a set stored under thekey
. Throws an exception if thekey
does not refer to a set.Unassigned keys are considered empty sets.
- Definition Classes
- SetCommands
- def sMembers(key: Buf): Future[Set[Buf]]
Gets the members of the set stored under the
key
.Gets the members of the set stored under the
key
. Throws an exception if thekey
does not refer to a set.- Definition Classes
- SetCommands
- def sPop(key: Buf): Future[Option[Buf]]
Removes an element randomly from the set stored under the
key
, and returns it.Removes an element randomly from the set stored under the
key
, and returns it. Throws an exception if the key does not refer to a set.- returns
Some
if the member exists, orNone
if the set is empty.
- Definition Classes
- SetCommands
- def sRandMember(key: Buf, count: Option[Int] = None): Future[Seq[Buf]]
Returns a list of random entries from the set stored under the
key
.Returns a list of random entries from the set stored under the
key
. If the count is positive, a set is returned, otherwise a list that may contain duplicates is returned.- Definition Classes
- SetCommands
- def sRem(key: Buf, members: List[Buf]): Future[Long]
Removes
members
from the set stored under thekey
.Removes
members
from the set stored under thekey
. Throws an exception if thekey
does not refer to a set.- returns
The number of elements removed from the set, can be 0 if the key is unassigned.
- Definition Classes
- SetCommands
- def sScan(key: Buf, cursor: Long, count: Option[Long], pattern: Option[Buf]): Future[Seq[Buf]]
Returns keys in given set
key
, starting atcursor
.Returns keys in given set
key
, starting atcursor
.- Definition Classes
- SetCommands
- def scans(cursor: Long, count: Option[Long], pattern: Option[Buf]): Future[Seq[Buf]]
Returns keys starting at cursor
Returns keys starting at cursor
- returns
cursor followed by matching keys
- Definition Classes
- KeyCommands
- def scriptExists(digests: Buf*): Future[Seq[Boolean]]
Returns whether each sha1 digest in "digests" indicates some valid script on redis-server script cache.
Returns whether each sha1 digest in "digests" indicates some valid script on redis-server script cache.
- Definition Classes
- ScriptCommands
- def scriptFlush(): Future[Unit]
Flushes the script cache on redis-server.
Flushes the script cache on redis-server.
- Definition Classes
- ScriptCommands
- def scriptLoad(script: Buf): Future[Buf]
Loads a script to redis-server script cache, and returns its SHA-1 digest as a HEX string.
Loads a script to redis-server script cache, and returns its SHA-1 digest as a HEX string.
Note that the SHA-1 digest of "script" (as a HEX string) can also be calculated locally, and it does equal what will be returned by redis-server, but this call, once succeeds, has the side effect of loading the script to the cache on redis-server.
- Definition Classes
- ScriptCommands
- def select(index: Int): Future[Unit]
Select DB with specified zero-based index
Select DB with specified zero-based index
- Definition Classes
- ConnectionCommands
- def set(key: Buf, value: Buf): Future[Unit]
Sets the given value to key.
Sets the given value to key. If a value already exists for the key, the value is overwritten with the new value
- Definition Classes
- StringCommands
- def setBit(key: Buf, offset: Int, value: Int): Future[Long]
Sets or clears the bit at offset in the string value stored at key.
Sets or clears the bit at offset in the string value stored at key.
- returns
the original bit value stored at offset.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/setbit
- def setEx(key: Buf, seconds: Long, value: Buf): Future[Unit]
Set key to hold the string value and set key to timeout after a given number of seconds.
Set key to hold the string value and set key to timeout after a given number of seconds.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/setex
- def setExNx(key: Buf, seconds: Long, value: Buf): Future[Boolean]
Set key to hold the string value with the specified expire time in seconds only if the key does not already exist.
Set key to hold the string value with the specified expire time in seconds only if the key does not already exist.
- returns
true if the key was set, false if condition was not met.
- Definition Classes
- StringCommands
- See also
https://redis.io.commands/set
- def setExXx(key: Buf, seconds: Long, value: Buf): Future[Boolean]
Set key to hold the string value with the specified expire time in seconds only if the key already exist.
Set key to hold the string value with the specified expire time in seconds only if the key already exist.
- returns
true if the key was set, false if condition was not met.
- Definition Classes
- StringCommands
- See also
https://redis.io.commands/set
- def setNx(key: Buf, value: Buf): Future[Boolean]
Set key to hold string value if key does not exist.
Set key to hold string value if key does not exist. In that case, it is equal to SET. When key already holds a value, no operation is performed.
- returns
1 if the key was set, 0 if the key was not set.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/setnx
- def setPx(key: Buf, millis: Long, value: Buf): Future[Unit]
Set key to hold the string value with the specified expire time in milliseconds.
Set key to hold the string value with the specified expire time in milliseconds.
- Definition Classes
- StringCommands
- See also
https://redis.io.commands/set
- def setPxNx(key: Buf, millis: Long, value: Buf): Future[Boolean]
Set key to hold the string value with the specified expire time in milliseconds only if the key does not already exist.
Set key to hold the string value with the specified expire time in milliseconds only if the key does not already exist.
- returns
true if the key was set, false if condition was not met.
- Definition Classes
- StringCommands
- See also
https://redis.io.commands/set
- def setPxXx(key: Buf, millis: Long, value: Buf): Future[Boolean]
Set key to hold the string value with the specified expire time in milliseconds only if the key already exist.
Set key to hold the string value with the specified expire time in milliseconds only if the key already exist.
- returns
true if the key was set, false if condition was not met.
- Definition Classes
- StringCommands
- See also
https://redis.io.commands/set
- def setRange(key: Buf, offset: Int, value: Buf): Future[Long]
Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.
Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.
- returns
the length of the string after it was modified.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/setrange
- def setXx(key: Buf, value: Buf): Future[Boolean]
Set key to hold the string value only if the key already exist.
Set key to hold the string value only if the key already exist.
- returns
true if the key was set, false if condition was not met.
- Definition Classes
- StringCommands
- See also
https://redis.io.commands/set
- def slaveOf(host: Buf, port: Buf): Future[Unit]
- Definition Classes
- ServerCommands
- def strlen(key: Buf): Future[Long]
returns the length of the string value stored at key.
returns the length of the string value stored at key.
- returns
the length of the string at key, or 0 when key does not exist.
- Definition Classes
- StringCommands
- See also
https://redis.io/commands/strlen
- def subscribe(channels: Seq[Buf])(handler: MessageHandler): Future[Map[Buf, Throwable]]
Subscribe to channels.
Subscribe to channels. Messages received from the subscribed channels will be processed by the handler.
A channel will be subscribed to only once. Subscribing to an already subscribed channel will be ignored. Although a Seq is passed in as argument, the channels are subscribed to one by one, with individual commands, and when the client is connected to multiple server nodes, it is not guaranteed that they are subscribed to from the same node.
When the Future returned by this method is completed, it is guaranteed that an attempt is made, to send a subscribe command for each of the channels that is not subscribed to yet. And the failed subscriptions are returned as a map from the failed channel to the exception object. Subscriptions will be managed by the SubscriptionManager, even if it failed at the first attempt. In that case, subsequent attempts will be made regularly until the channel is subscribed to successfully, or the subscription is cancelled by calling the unsubscribed method.
- Definition Classes
- SubscribeCommands
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def topologyAdd(key: Buf, value: Buf): Future[Unit]
Adds a
key
:value
pair to a topology.Adds a
key
:value
pair to a topology.- Definition Classes
- TopologyCommands
- def topologyDelete(key: Buf): Future[Unit]
Deletes a pair with a
key
from a topology.Deletes a pair with a
key
from a topology.- Definition Classes
- TopologyCommands
- def topologyGet(key: Buf): Future[Option[Buf]]
Gets a value stored under
key
from a topology.Gets a value stored under
key
from a topology.- Definition Classes
- TopologyCommands
- def transaction[T](f: (NormalCommands) => Future[_]): Future[Seq[Reply]]
- Definition Classes
- Transactions
- def transaction[T](cmds: Seq[Command]): Future[Seq[Reply]]
- Definition Classes
- Transactions
- def transactionSupport[T](f: (TransactionalClient) => Future[T]): Future[T]
- Definition Classes
- Transactions
- def ttl(key: Buf): Future[Option[Long]]
Gets the ttl of the given key.
Gets the ttl of the given key.
- returns
Option containing either the ttl in seconds if the key exists and has a timeout, or else nothing.
- Definition Classes
- KeyCommands
- def unsubscribe(channels: Seq[Buf]): Future[Map[Buf, Throwable]]
Unsubscribe from channels.
Unsubscribe from channels. The subscriptions to the specified channels are removed from the SubscriptionManager. An unsubscribe command is sent for each of the succeeded subscriptions, and the failed ones are returned as a Future of map from the channel to the exception object.
- Definition Classes
- SubscribeCommands
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def xAck(key: Buf, group: Buf, ids: Seq[Buf]): Future[Long]
Removes entries from the pending list with
ids
from the stream atkey
within the context ofgroup
Removes entries from the pending list with
ids
from the stream atkey
within the context ofgroup
- key
The stream the entry belongs to
- group
The consumer group to ACK the entries on behalf of
- ids
The entry IDs to ACK
- returns
The number of messages acked
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xack
- def xAdd(key: Buf, id: Option[Buf], fv: Map[Buf, Buf]): Future[Buf]
Pushes the fields and values in
fv
onto the stream atkey
.Pushes the fields and values in
fv
onto the stream atkey
. Ifid
is None an ID will be generated for the message, otherwise the passedid
will be used- key
The key of the stream to add the key-pairs to
- id
The ID to use for the new record. Pass "*" to make Redis generate a unique ID for the record
- fv
A Map of key-value pairs representing the record
- returns
The ID for the message
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xadd
- def xClaim(key: Buf, group: Buf, consumer: Buf, minIdleTime: Long, ids: Seq[Buf], idle: Option[XClaimMillisOrUnixTs], retryCount: Option[Long], force: Boolean, justId: Boolean): Future[Seq[StreamEntryReply]]
Changes the ownership of pending entries to
consumer
withids
within the stream atkey
within the context ofgroup
.Changes the ownership of pending entries to
consumer
withids
within the stream atkey
within the context ofgroup
.- key
The stream key the consumer group is consuming
- group
The consumer group the consumer belongs to
- consumer
The consumer that is claiming ownership of the entry
- minIdleTime
The minimum idle time an entry must have to be claimed
- ids
The entry IDs to "claim"
- idle
Sets the idle time of the pending messages. Can be specified in milliseconds of millisecond-unix-time
- retryCount
Sets the retry counter for the entries
- force
If true, creates entries in the pending entry list for IDs that did not already exist in the list
- justId
If true, returns just the pending message IDs in the response
- returns
If justId is true, a sequence of claimed IDs, otherwise claimed IDs and the contents of the entries
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xclaim
- def xDel(key: Buf, ids: Seq[Buf]): Future[Long]
Removes specified entries from the stream at
key
Removes specified entries from the stream at
key
- key
The key of the stream to delete records from
- ids
The keys to delete from the stream
- returns
The number of entries deleted
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xdel
- def xGroupCreate(key: Buf, groupName: Buf, id: Buf): Future[Unit]
Creates a new consumer group named
groupName
for streamkey
starting at entryid
Creates a new consumer group named
groupName
for streamkey
starting at entryid
- key
The stream key that the group will consume
- groupName
The name of the new consumer group
- id
The ID of the last delivered item from the stream, i.e. where the group begins consuming from
- returns
Successful if the group is successfully created
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xgroup
- def xGroupDelConsumer(key: Buf, groupName: Buf, consumerName: Buf): Future[Unit]
Deletes a specific consumer within a consumer group
Deletes a specific consumer within a consumer group
- key
The stream the group consumes
- groupName
The group the consumer belongs to
- consumerName
The consumer to delete
- returns
Successful if the group was deleted
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xgroup
- def xGroupDestroy(key: Buf, groupName: Buf): Future[Unit]
Deletes a consumer group
Deletes a consumer group
- key
The stream the group consumes
- groupName
The group to delete
- returns
Successful if the group was deleted
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xgroup
- def xGroupSetId(key: Buf, id: Buf): Future[Unit]
Sets the ID of the next item to deliver to consumers within a group
Sets the ID of the next item to deliver to consumers within a group
- key
The stream key the group consumes
- id
The new ID that the consumer groups begins consuming from
- returns
Successful if the ID is successfully changed
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xgroup
- def xLen(key: Buf): Future[Long]
Retrieve the length of a stream
Retrieve the length of a stream
- key
The key of the stream to retrieve records from
- returns
The number of entries in the stream
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xlen
- def xPending(key: Buf, group: Buf, start: Buf, end: Buf, count: Long, consumer: Option[Buf]): Future[Seq[XPendingRangeReply]]
Returns all pending messages within a range, optionally for a specific consumer.
Returns all pending messages within a range, optionally for a specific consumer. Includes additional details about the pending messages relatieve to XPENDING called without an ID-range.
- key
The stream the group consumes
- group
The consumer group consuming the stream
- start
The inclusive, minimum stream record ID to start retrieving records from
- end
The inclusive, maximum stream record ID to start retrieving records from
- count
The maximum number of pending entries to retrieve
- consumer
If specified, retrieves only pending entries for a given consumer
- returns
A sequence of pending entries which include details about the pending messages
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xpending
- def xPending(key: Buf, group: Buf): Future[XPendingAllReply]
Retrieves all pending messages within the stream at
key
forgroup
Retrieves all pending messages within the stream at
key
forgroup
- key
The stream the group consumes
- group
The consumer group consuming the stream
- returns
A listing of pending entries for the particular consumer group
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xpending
- def xRange(key: Buf, start: Buf, end: Buf, count: Option[Long]): Future[Seq[StreamEntryReply]]
Returns entries from the stream at
key
in the range ofstart
toend
.Returns entries from the stream at
key
in the range ofstart
toend
. Ifcount
is specified no more thancount
items will be returned- key
The key of the stream to retrieve records from
- start
The inclusive, minimum stream record ID to start retrieving records from
- end
The inclusive, maximum stream record ID to start retrieving records from
- count
The maximum number of entries to retrieve from the stream
- returns
A sequence of entries
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xrange
- def xRead(count: Option[Long], blockMs: Option[Long], keys: Seq[Buf], ids: Seq[Buf]): Future[Seq[XReadStreamReply]]
Reads entries from one or many streams
Reads entries from one or many streams
- count
The maximum amount of messages to return per-stream
- blockMs
If no messages are available on the given streams, block for this many millis to awai entries
- keys
The keys of the streams to retrieve records from
- ids
The last ID retrieved for each stream. On the first call to XREAD, "$" should be passed as the first ID for each stream
- returns
A sequence of streams each containing a sequence of read entries
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xread
- def xReadGroup(group: Buf, consumer: Buf, count: Option[Long], blockMs: Option[Long], keys: Seq[Buf], ids: Seq[Buf]): Future[Seq[XReadStreamReply]]
Reads from one or many streams within the context
group
forconsumer
.Reads from one or many streams within the context
group
forconsumer
.- group
The group identifier that the consumer belongs to
- consumer
The consumer ID to consume on behalf of
- count
The maximum amount of messages to return per-stream
- blockMs
If no messages are available on the given streams, block for this many millis to awai entries
- keys
The keys of the streams to retrieve records from
- ids
The last ID retrieved for each stream. On the first call to XREAD, "$" should be passed as the first ID for each stream
- returns
A sequence of streams each containing a sequence of read entries
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xreadgroup
- def xRevRange(key: Buf, start: Buf, end: Buf, count: Option[Long]): Future[Seq[StreamEntryReply]]
Like XRANGE, but returns entries in reverse order
Like XRANGE, but returns entries in reverse order
- key
The key of the stream to retrieve records from
- start
The inclusive, maximum stream record ID to start retrieving records from
- end
The inclusive, minimum stream record ID to start retrieving records from
- count
The maximum number of entries to retrieve from the stream
- returns
A sequence of entries
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xrevrange
- def xTrim(key: Buf, size: Long, exact: Boolean): Future[Long]
Trims the stream at
key
to a particular number of items indicated bysize
.Trims the stream at
key
to a particular number of items indicated bysize
. Ifexact
is false, Redis will trim to approximately the indicated size (which is more efficient)- key
The key of the stream to trim
- size
The size to trim the stream to
- exact
If true, trims the stream exactly. Otherwise, Redis internally approximates the size and optionally trims based on the approximation
- returns
The number of items removed from the stream
- Definition Classes
- StreamCommands
- See also
https://redis.io/commands/xtrim
- def zAdd(key: Buf, score: Double, member: Buf): Future[Long]
Adds a
member
withscore
to a sorted set under thekey
.Adds a
member
withscore
to a sorted set under thekey
.- returns
The number of elements added to sorted set.
- Definition Classes
- SortedSetCommands
- def zAddMulti(key: Buf, members: Seq[(Double, Buf)]): Future[Long]
Adds member -> score pair
members
to sorted set under thekey
.Adds member -> score pair
members
to sorted set under thekey
.- returns
The number of elements added to sorted set.
- Definition Classes
- SortedSetCommands
- Note
Adding multiple elements only works with redis 2.4 or later.
- def zCard(key: Buf): Future[Long]
Returns cardinality of the sorted set under the
key
, or 0 ifkey
does not exist.Returns cardinality of the sorted set under the
key
, or 0 ifkey
does not exist.- Definition Classes
- SortedSetCommands
- def zCount(key: Buf, min: ZInterval, max: ZInterval): Future[Long]
Gets number of elements in sorted set under the
key
with score betweenmin
andmax
.Gets number of elements in sorted set under the
key
with score betweenmin
andmax
.- Definition Classes
- SortedSetCommands
- def zIncrBy(key: Buf, amount: Double, member: Buf): Future[Option[Double]]
Increments the
member
in sorted set at thekey
by a givenamount
.Increments the
member
in sorted set at thekey
by a givenamount
. ReturnsSome
of the new value of the incremented member orNone
if the member is not found or the set is empty. Throws an exception if the key refers to a structure that is not a sorted set.- Definition Classes
- SortedSetCommands
- def zPopMax(key: Buf, count: Option[Long]): Future[Either[ZRangeResults, Seq[Buf]]]
Removes and returns up to
count
members with the highest scores in the sorted set stored atkey
.Removes and returns up to
count
members with the highest scores in the sorted set stored atkey
.- Definition Classes
- SortedSetCommands
- def zPopMin(key: Buf, count: Option[Long]): Future[Either[ZRangeResults, Seq[Buf]]]
Removes and returns up to
count
members with the lowest scores in the sorted set stored atkey
.Removes and returns up to
count
members with the lowest scores in the sorted set stored atkey
.- Definition Classes
- SortedSetCommands
- def zRange(key: Buf, start: Long, stop: Long, withScores: Boolean): Future[Either[ZRangeResults, Seq[Buf]]]
Returns specified range (from
start
tostop
) of elements in sorted set at thekey
.Returns specified range (from
start
tostop
) of elements in sorted set at thekey
. Elements are ordered from lowest to highest score.- Definition Classes
- SortedSetCommands
- def zRangeByScore(key: Buf, min: ZInterval, max: ZInterval, withScores: Boolean, limit: Option[Limit]): Future[Either[ZRangeResults, Seq[Buf]]]
Gets member -> score pairs from sorted set under the
key
betweenmin
andmax
.Gets member -> score pairs from sorted set under the
key
betweenmin
andmax
. Results are limited bylimit
.- Definition Classes
- SortedSetCommands
- def zRank(key: Buf, member: Buf): Future[Option[Long]]
Gets the rank of the
member
in the sorted set at thekey
, orNone
if it doesn't exist.Gets the rank of the
member
in the sorted set at thekey
, orNone
if it doesn't exist.- Definition Classes
- SortedSetCommands
- def zRem(key: Buf, members: Seq[Buf]): Future[Long]
Removes specified
members
from sorted set atkey
.Removes specified
members
from sorted set atkey
.- returns
The number of members removed.
- Definition Classes
- SortedSetCommands
- def zRemRangeByRank(key: Buf, start: Long, stop: Long): Future[Long]
Removes members from sorted set at the
key
by sort order, fromstart
tostop
, inclusive.Removes members from sorted set at the
key
by sort order, fromstart
tostop
, inclusive.- returns
The number of members removed from sorted set.
- Definition Classes
- SortedSetCommands
- def zRemRangeByScore(key: Buf, min: ZInterval, max: ZInterval): Future[Long]
Removes members from sorted set at the
key
by score, frommin
tomax
, inclusive.Removes members from sorted set at the
key
by score, frommin
tomax
, inclusive.- returns
The number of members removed from sorted set.
- Definition Classes
- SortedSetCommands
- def zRevRange(key: Buf, start: Long, stop: Long, withScores: Boolean): Future[Either[ZRangeResults, Seq[Buf]]]
Returns specified range (from
start
toend
) of elements in sorted set atkey
.Returns specified range (from
start
toend
) of elements in sorted set atkey
. Elements are ordered from highest to lowest score.- Definition Classes
- SortedSetCommands
- def zRevRangeByScore(key: Buf, max: ZInterval, min: ZInterval, withScores: Boolean, limit: Option[Limit]): Future[Either[ZRangeResults, Seq[Buf]]]
Returns elements in sorted set at
key
with a score betweenmax
andmin
.Returns elements in sorted set at
key
with a score betweenmax
andmin
. Elements are ordered from highest to lowest score Results are limited bylimit
.- Definition Classes
- SortedSetCommands
- def zRevRank(key: Buf, member: Buf): Future[Option[Long]]
Gets the rank of a
member
in the sorted set at thekey
, orNone
if it doesn't exist.Gets the rank of a
member
in the sorted set at thekey
, orNone
if it doesn't exist.- Definition Classes
- SortedSetCommands
- def zScan(key: Buf, cursor: Long, count: Option[Long], pattern: Option[Buf]): Future[Seq[Buf]]
Returns keys in given set
key
, starting atcursor
.Returns keys in given set
key
, starting atcursor
.- Definition Classes
- SortedSetCommands
- def zScore(key: Buf, member: Buf): Future[Option[Double]]
Gets the score of a
member
in sorted set at thekey
.Gets the score of a
member
in sorted set at thekey
.- Definition Classes
- SortedSetCommands