K
- Key type.V
- Value type.public class RedisPubSubAsyncCommandsImpl<K,V> extends RedisAsyncCommandsImpl<K,V> implements RedisPubSubConnection<K,V>, RedisPubSubAsyncCommands<K,V>
codec, connection, multi
Constructor and Description |
---|
RedisPubSubAsyncCommandsImpl(StatefulRedisPubSubConnection<K,V> connection,
RedisCodec<K,V> codec)
Initialize a new connection.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(RedisPubSubListener<K,V> listener)
Add a new listener.
|
StatefulRedisPubSubConnection<K,V> |
getStatefulConnection() |
RedisFuture<Void> |
psubscribe(K... patterns)
Listen for messages published to channels matching the given patterns.
|
RedisFuture<Long> |
publish(K channel,
V message)
Post a message to a channel.
|
RedisFuture<List<K>> |
pubsubChannels(K channel)
Lists the currently *active channels*.
|
RedisFuture<Map<K,Long>> |
pubsubNumsub(K... channels)
Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.
|
RedisFuture<Void> |
punsubscribe(K... patterns)
Stop listening for messages posted to channels matching the given patterns.
|
void |
removeListener(RedisPubSubListener<K,V> listener)
Remove an existing listener.
|
RedisFuture<Void> |
subscribe(K... channels)
Listen for messages published to the given channels.
|
RedisFuture<Void> |
unsubscribe(K... channels)
Stop listening for messages posted to the given channels.
|
append, asking, auth, authAsync, bgrewriteaof, bgsave, bitcount, bitcount, bitfield, bitopAnd, bitopNot, bitopOr, bitopXor, bitpos, bitpos, bitpos, blpop, brpop, brpoplpush, bzpopmax, bzpopmin, clientGetname, clientKill, clientKill, clientList, clientPause, clientSetname, clientUnblock, close, clusterAddSlots, clusterBumpepoch, clusterCountFailureReports, clusterCountKeysInSlot, clusterDelSlots, clusterFailover, clusterFlushslots, clusterForget, clusterGetKeysInSlot, clusterInfo, clusterKeyslot, clusterMeet, clusterMyId, clusterNodes, clusterReplicate, clusterReset, clusterSaveconfig, clusterSetConfigEpoch, clusterSetSlotImporting, clusterSetSlotMigrating, clusterSetSlotNode, clusterSetSlotStable, clusterSlaves, clusterSlots, command, commandCount, commandInfo, commandInfo, configGet, configResetstat, configRewrite, configSet, dbsize, debugCrashAndRecover, debugHtstats, debugObject, debugOom, debugReload, debugRestart, debugSdslen, debugSegfault, decr, decrby, del, del, digest, discard, dispatch, dispatch, dispatch, dispatch, dispatch, dump, echo, eval, eval, evalsha, evalsha, exec, exists, exists, exists, expire, expireat, expireat, flushall, flushallAsync, flushCommands, flushdb, flushdbAsync, geoadd, geoadd, geodist, geohash, geopos, georadius_ro, georadius_ro, georadius, georadius, georadius, georadiusbymember_ro, georadiusbymember_ro, georadiusbymember, georadiusbymember, georadiusbymember, get, getbit, getConnection, getrange, getset, hdel, hexists, hget, hgetall, hgetall, hincrby, hincrbyfloat, hkeys, hkeys, hlen, hmget, hmget, hmset, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hset, hsetnx, hstrlen, hvals, hvals, incr, incrby, incrbyfloat, info, info, isOpen, keys, keys, lastsave, lindex, linsert, llen, lpop, lpush, lpushx, lpushx, lrange, lrange, lrem, lset, ltrim, mget, mget, mget, mget, migrate, migrate, move, mset, msetnx, multi, objectEncoding, objectIdletime, objectRefcount, persist, pexpire, pexpireat, pexpireat, pfadd, pfadd, pfcount, pfcount, pfmerge, pfmerge, ping, psetex, pttl, pubsubChannels, pubsubNumpat, quit, randomkey, readOnly, readWrite, rename, renamenx, reset, restore, restore, role, rpop, rpoplpush, rpush, rpushx, rpushx, sadd, save, scan, scan, scan, scan, scan, scan, scan, scan, scard, scriptExists, scriptFlush, scriptKill, scriptLoad, sdiff, sdiff, sdiffstore, select, selectAsync, set, set, setAutoFlushCommands, setbit, setex, setnx, setrange, setTimeout, shutdown, shutdown, sinter, sinter, sinterstore, sismember, slaveof, slaveofNoOne, slowlogGet, slowlogGet, slowlogLen, slowlogReset, smembers, smembers, smove, sort, sort, sort, sort, sortStore, spop, spop, srandmember, srandmember, srandmember, srem, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sscan, strlen, sunion, sunion, sunionstore, swapdb, sync, time, touch, touch, ttl, type, unlink, unlink, unwatch, waitForReplication, watch, xack, xadd, xadd, xadd, xadd, xclaim, xclaim, xdel, xgroupCreate, xgroupDelconsumer, xgroupDestroy, xgroupSetid, xlen, xpending, xpending, xpending, xrange, xrange, xread, xread, xreadgroup, xreadgroup, xrevrange, xrevrange, xtrim, xtrim, zadd, zadd, zadd, zadd, zadd, zadd, zaddincr, zaddincr, zcard, zcount, zcount, zcount, zincrby, zinterstore, zinterstore, zlexcount, zlexcount, zpopmax, zpopmax, zpopmin, zpopmin, zrange, zrange, zrangebylex, zrangebylex, zrangebylex, zrangebylex, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangeWithScores, zrangeWithScores, zrank, zrem, zremrangebylex, zremrangebylex, zremrangebyrank, zremrangebyscore, zremrangebyscore, zremrangebyscore, zrevrange, zrevrange, zrevrangebylex, zrevrangebylex, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangeWithScores, zrevrangeWithScores, zrevrank, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscore, zunionstore, zunionstore
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
auth, select, setTimeout, swapdb
asking, clusterAddSlots, clusterBumpepoch, clusterCountFailureReports, clusterCountKeysInSlot, clusterDelSlots, clusterFailover, clusterFlushslots, clusterForget, clusterGetKeysInSlot, clusterInfo, clusterKeyslot, clusterMeet, clusterMyId, clusterNodes, clusterReplicate, clusterReset, clusterSaveconfig, clusterSetConfigEpoch, clusterSetSlotImporting, clusterSetSlotMigrating, clusterSetSlotNode, clusterSetSlotStable, clusterSlaves, clusterSlots, del, mget, mset, msetnx, readOnly, readWrite
geoadd, geoadd, geodist, geohash, geopos, georadius, georadius, georadius, georadiusbymember, georadiusbymember, georadiusbymember
hdel, hexists, hget, hgetall, hgetall, hincrby, hincrbyfloat, hkeys, hkeys, hlen, hmget, hmget, hmset, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hset, hsetnx, hstrlen, hvals, hvals
pfadd, pfcount, pfmerge
dump, exists, expire, expireat, expireat, keys, keys, migrate, migrate, move, objectEncoding, objectIdletime, objectRefcount, persist, pexpire, pexpireat, pexpireat, pttl, randomkey, rename, renamenx, restore, restore, scan, scan, scan, scan, scan, scan, scan, scan, sort, sort, sort, sort, sortStore, touch, ttl, type, unlink
blpop, brpop, brpoplpush, lindex, linsert, llen, lpop, lpush, lpushx, lpushx, lrange, lrange, lrem, lset, ltrim, rpop, rpoplpush, rpush, rpushx, rpushx
digest, eval, eval, evalsha, evalsha, scriptExists, scriptFlush, scriptKill, scriptLoad
bgrewriteaof, bgsave, clientGetname, clientKill, clientKill, clientList, clientPause, clientSetname, clientUnblock, command, commandCount, commandInfo, commandInfo, configGet, configResetstat, configRewrite, configSet, dbsize, debugCrashAndRecover, debugHtstats, debugObject, debugOom, debugReload, debugRestart, debugSdslen, debugSegfault, flushall, flushallAsync, flushdb, flushdbAsync, info, info, lastsave, save, shutdown, slaveof, slaveofNoOne, slowlogGet, slowlogGet, slowlogLen, slowlogReset, sync, time
sadd, scard, sdiff, sdiff, sdiffstore, sinter, sinter, sinterstore, sismember, smembers, smembers, smove, spop, spop, srandmember, srandmember, srandmember, srem, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sunion, sunion, sunionstore
bzpopmax, bzpopmin, zadd, zadd, zadd, zadd, zadd, zadd, zaddincr, zaddincr, zcard, zcount, zcount, zcount, zincrby, zinterstore, zinterstore, zlexcount, zlexcount, zpopmax, zpopmax, zpopmin, zpopmin, zrange, zrange, zrangebylex, zrangebylex, zrangebylex, zrangebylex, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscore, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangebyscoreWithScores, zrangeWithScores, zrangeWithScores, zrank, zrem, zremrangebylex, zremrangebylex, zremrangebyrank, zremrangebyscore, zremrangebyscore, zremrangebyscore, zrevrange, zrevrange, zrevrangebylex, zrevrangebylex, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscore, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangebyscoreWithScores, zrevrangeWithScores, zrevrangeWithScores, zrevrank, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscore, zunionstore, zunionstore
xack, xadd, xadd, xadd, xadd, xclaim, xclaim, xdel, xgroupCreate, xgroupDelconsumer, xgroupDestroy, xgroupSetid, xlen, xpending, xpending, xpending, xrange, xrange, xread, xread, xreadgroup, xreadgroup, xrevrange, xrevrange, xtrim, xtrim
append, bitcount, bitcount, bitfield, bitopAnd, bitopNot, bitopOr, bitopXor, bitpos, bitpos, bitpos, decr, decrby, get, getbit, getrange, getset, incr, incrby, incrbyfloat, mget, psetex, set, set, setbit, setex, setnx, setrange, strlen
public RedisPubSubAsyncCommandsImpl(StatefulRedisPubSubConnection<K,V> connection, RedisCodec<K,V> codec)
connection
- the connection .codec
- Codec used to encode/decode keys and values.public void addListener(RedisPubSubListener<K,V> listener)
addListener
in interface RedisPubSubAsyncCommands<K,V>
addListener
in interface RedisPubSubConnection<K,V>
listener
- Listener.public void removeListener(RedisPubSubListener<K,V> listener)
removeListener
in interface RedisPubSubAsyncCommands<K,V>
removeListener
in interface RedisPubSubConnection<K,V>
listener
- Listener.public RedisFuture<Void> psubscribe(K... patterns)
RedisPubSubConnection
psubscribe
in interface RedisPubSubAsyncCommands<K,V>
psubscribe
in interface RedisPubSubConnection<K,V>
patterns
- the patternspsubscribe
completionpublic RedisFuture<Void> punsubscribe(K... patterns)
RedisPubSubConnection
punsubscribe
in interface RedisPubSubAsyncCommands<K,V>
punsubscribe
in interface RedisPubSubConnection<K,V>
patterns
- the patternspunsubscribe
completionpublic RedisFuture<Void> subscribe(K... channels)
RedisPubSubConnection
subscribe
in interface RedisPubSubAsyncCommands<K,V>
subscribe
in interface RedisPubSubConnection<K,V>
channels
- the channelssubscribe
completionpublic RedisFuture<Void> unsubscribe(K... channels)
RedisPubSubConnection
unsubscribe
in interface RedisPubSubAsyncCommands<K,V>
unsubscribe
in interface RedisPubSubConnection<K,V>
channels
- the channelsunsubscribe
completion.public RedisFuture<Long> publish(K channel, V message)
BaseRedisAsyncConnection
publish
in interface BaseRedisAsyncCommands<K,V>
publish
in interface BaseRedisAsyncConnection<K,V>
publish
in class AbstractRedisAsyncCommands<K,V>
channel
- the channel type: keymessage
- the message type: valuepublic RedisFuture<List<K>> pubsubChannels(K channel)
BaseRedisAsyncConnection
pubsubChannels
in interface BaseRedisAsyncCommands<K,V>
pubsubChannels
in interface BaseRedisAsyncConnection<K,V>
pubsubChannels
in class AbstractRedisAsyncCommands<K,V>
channel
- the keypublic RedisFuture<Map<K,Long>> pubsubNumsub(K... channels)
BaseRedisAsyncConnection
pubsubNumsub
in interface BaseRedisAsyncCommands<K,V>
pubsubNumsub
in interface BaseRedisAsyncConnection<K,V>
pubsubNumsub
in class AbstractRedisAsyncCommands<K,V>
channels
- channel keyspublic StatefulRedisPubSubConnection<K,V> getStatefulConnection()
getStatefulConnection
in interface RedisAsyncCommands<K,V>
getStatefulConnection
in interface RedisPubSubAsyncCommands<K,V>
getStatefulConnection
in interface RedisAsyncConnection<K,V>
getStatefulConnection
in class RedisAsyncCommandsImpl<K,V>
Copyright © 2018 lettuce.io. All rights reserved.