Package io.lettuce.core.pubsub
Class RedisPubSubReactiveCommandsImpl<K,V>
- java.lang.Object
-
- io.lettuce.core.AbstractRedisReactiveCommands<K,V>
-
- io.lettuce.core.RedisReactiveCommandsImpl<K,V>
-
- io.lettuce.core.pubsub.RedisPubSubReactiveCommandsImpl<K,V>
-
- Type Parameters:
K
- Key type.V
- Value type.
- All Implemented Interfaces:
BaseRedisReactiveCommands<K,V>
,RedisAclReactiveCommands<K,V>
,RedisFunctionReactiveCommands<K,V>
,RedisGeoReactiveCommands<K,V>
,RedisHashReactiveCommands<K,V>
,RedisHLLReactiveCommands<K,V>
,RedisKeyReactiveCommands<K,V>
,RedisListReactiveCommands<K,V>
,RedisReactiveCommands<K,V>
,RedisScriptingReactiveCommands<K,V>
,RedisServerReactiveCommands<K,V>
,RedisSetReactiveCommands<K,V>
,RedisSortedSetReactiveCommands<K,V>
,RedisStreamReactiveCommands<K,V>
,RedisStringReactiveCommands<K,V>
,RedisTransactionalReactiveCommands<K,V>
,RedisClusterReactiveCommands<K,V>
,RedisPubSubReactiveCommands<K,V>
- Direct Known Subclasses:
RedisClusterPubSubReactiveCommandsImpl
public class RedisPubSubReactiveCommandsImpl<K,V> extends RedisReactiveCommandsImpl<K,V> implements RedisPubSubReactiveCommands<K,V>
A reactive and thread-safe API for a Redis pub/sub connection.- Since:
- 5.0
- Author:
- Mark Paluch
-
-
Constructor Summary
Constructors Constructor Description RedisPubSubReactiveCommandsImpl(StatefulRedisPubSubConnection<K,V> connection, RedisCodec<K,V> codec)
Initialize a new connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StatefulRedisPubSubConnection<K,V>
getStatefulConnection()
Flux<ChannelMessage<K,V>>
observeChannels()
Flux for messages (message) received though channel subscriptions.Flux<ChannelMessage<K,V>>
observeChannels(FluxSink.OverflowStrategy overflowStrategy)
Flux for messages (message) received though channel subscriptions.Flux<PatternMessage<K,V>>
observePatterns()
Flux for messages (pmessage) received though pattern subscriptions.Flux<PatternMessage<K,V>>
observePatterns(FluxSink.OverflowStrategy overflowStrategy)
Flux for messages (pmessage) received though pattern subscriptions.Mono<Void>
psubscribe(K... patterns)
Listen for messages published to channels matching the given patterns.Mono<Long>
publish(K channel, V message)
Post a message to a channel.Flux<K>
pubsubChannels(K channel)
Lists the currently *active channels*.Mono<Map<K,Long>>
pubsubNumsub(K... channels)
Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.Mono<Void>
punsubscribe(K... patterns)
Stop listening for messages posted to channels matching the given patterns.Mono<Void>
subscribe(K... channels)
Listen for messages published to the given channels.Mono<Void>
unsubscribe(K... channels)
Stop listening for messages posted to the given channels.-
Methods inherited from class io.lettuce.core.AbstractRedisReactiveCommands
aclCat, aclCat, aclDeluser, aclDryRun, aclDryRun, aclGenpass, aclGenpass, aclGetuser, aclList, aclLoad, aclLog, aclLog, aclLogReset, aclSave, aclSetuser, aclUsers, aclWhoami, append, asking, auth, auth, bgrewriteaof, bgsave, bitcount, bitcount, bitfield, bitopAnd, bitopNot, bitopOr, bitopXor, bitpos, bitpos, bitpos, blmove, blmove, blmpop, blmpop, blpop, blpop, brpop, brpop, brpoplpush, brpoplpush, bzmpop, bzmpop, bzmpop, bzmpop, bzpopmax, bzpopmax, bzpopmin, bzpopmin, clientCaching, clientGetname, clientGetredir, clientId, clientInfo, clientKill, clientKill, clientList, clientList, clientNoEvict, clientPause, clientSetinfo, clientSetname, clientTracking, clientUnblock, close, clusterAddSlots, clusterAddSlotsRange, clusterBumpepoch, clusterCountFailureReports, clusterCountKeysInSlot, clusterDelSlots, clusterDelSlotsRange, clusterFailover, clusterFailover, clusterFlushslots, clusterForget, clusterGetKeysInSlot, clusterInfo, clusterKeyslot, clusterMeet, clusterMyId, clusterNodes, clusterReplicas, clusterReplicate, clusterReset, clusterSaveconfig, clusterSetConfigEpoch, clusterSetSlotImporting, clusterSetSlotMigrating, clusterSetSlotNode, clusterSetSlotStable, clusterShards, clusterSlaves, clusterSlots, command, commandCount, commandInfo, commandInfo, configGet, configGet, configResetstat, configRewrite, configSet, configSet, copy, copy, createDissolvingFlux, createFlux, createMono, createMono, dbsize, debugCrashAndRecover, debugHtstats, debugObject, debugOom, debugReload, debugRestart, debugSdslen, debugSegfault, decr, decrby, del, del, digest, digest, discard, dispatch, dispatch, dump, echo, eval, eval, eval, eval, evalReadOnly, evalsha, evalsha, evalshaReadOnly, exec, exists, exists, exists, expire, expire, expire, expire, expireat, expireat, expireat, expireat, expireat, expireat, expiretime, fcall, fcall, fcallReadOnly, fcallReadOnly, flushall, flushall, flushallAsync, flushCommands, flushdb, flushdb, flushdbAsync, functionDump, functionFlush, functionKill, functionList, functionList, functionLoad, functionLoad, functionRestore, functionRestore, geoadd, geoadd, geoadd, geoadd, geoadd, geoadd, geodist, geohash, geopos, georadius, georadius, georadius, georadius_ro, georadius_ro, georadiusbymember, georadiusbymember, georadiusbymember, georadiusbymember_ro, georadiusbymember_ro, geosearch, geosearch, geosearchstore, get, getbit, getConnection, getdel, getex, getrange, getset, hdel, hexists, hget, hgetall, hgetall, hincrby, hincrbyfloat, hkeys, hkeys, hlen, hmget, hmget, hmset, hrandfield, hrandfield, hrandfieldWithvalues, hrandfieldWithvalues, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hset, hset, hsetnx, hstrlen, hvals, hvals, incr, incrby, incrbyfloat, info, info, isOpen, keys, keys, lastsave, lindex, linsert, llen, lmove, lmpop, lpop, lpop, lpos, lpos, lpos, lpos, lpush, lpushx, lrange, lrange, lrem, lset, ltrim, memoryUsage, mget, mget, mget, mget, mget, migrate, migrate, move, mset, msetnx, multi, objectEncoding, objectFreq, objectIdletime, objectRefcount, persist, pexpire, pexpire, pexpire, pexpire, pexpireat, pexpireat, pexpireat, pexpireat, pexpireat, pexpireat, pexpiretime, pfadd, pfadd, pfcount, pfcount, pfmerge, pfmerge, ping, psetex, pttl, pubsubChannels, pubsubNumpat, quit, randomkey, readOnly, readWrite, rename, renamenx, replicaof, replicaofNoOne, reset, restore, restore, role, rpop, rpop, rpoplpush, rpush, rpushx, sadd, save, scan, scan, scan, scan, scan, scan, scan, scan, scard, scriptExists, scriptFlush, scriptFlush, scriptKill, scriptLoad, scriptLoad, sdiff, sdiff, sdiffstore, select, set, set, setAutoFlushCommands, setbit, setex, setGet, setGet, setnx, setrange, setTimeout, shutdown, shutdown, sinter, sinter, sintercard, sintercard, sinterstore, sismember, slaveof, slaveofNoOne, slowlogGet, slowlogGet, slowlogLen, slowlogReset, smembers, smembers, smismember, smove, sort, sort, sort, sort, sortReadOnly, sortReadOnly, sortReadOnly, sortReadOnly, sortStore, spop, spop, srandmember, srandmember, srandmember, srem, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sscan, stralgoLcs, strlen, sunion, sunion, sunionstore, swapdb, time, touch, touch, ttl, type, unlink, unlink, unwatch, waitForReplication, watch, xack, xadd, xadd, xadd, xadd, xautoclaim, xclaim, xclaim, xdel, xgroupCreate, xgroupCreate, xgroupCreateconsumer, xgroupDelconsumer, xgroupDestroy, xgroupSetid, xinfoConsumers, xinfoGroups, xinfoStream, xlen, xpending, xpending, xpending, xpending, xrange, xrange, xread, xread, xreadgroup, xreadgroup, xrevrange, xrevrange, xtrim, xtrim, xtrim, zadd, zadd, zadd, zadd, zadd, zadd, zaddincr, zaddincr, zcard, zcount, zcount, zcount, zdiff, zdiffstore, zdiffWithScores, zincrby, zinter, zinter, zintercard, zintercard, zinterstore, zinterstore, zinterWithScores, zinterWithScores, zlexcount, zlexcount, zmpop, zmpop, zmscore, zpopmax, zpopmax, zpopmin, zpopmin, zrandmember, zrandmember, zrandmemberWithScores, zrandmemberWithScores, 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, zrangestore, zrangestorebylex, zrangestorebyscore, zrangeWithScores, zrangeWithScores, zrank, zrankWithScore, 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, zrevrangestore, zrevrangestorebylex, zrevrangestorebyscore, zrevrangeWithScores, zrevrangeWithScores, zrevrank, zrevrankWithScore, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscore, zunion, zunion, zunionstore, zunionstore, zunionWithScores, zunionWithScores
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.lettuce.core.api.reactive.BaseRedisReactiveCommands
dispatch, dispatch, echo, flushCommands, isOpen, ping, pubsubChannels, pubsubNumpat, quit, reset, role, setAutoFlushCommands, waitForReplication
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisAclReactiveCommands
aclCat, aclCat, aclDeluser, aclDryRun, aclDryRun, aclGenpass, aclGenpass, aclGetuser, aclList, aclLoad, aclLog, aclLog, aclLogReset, aclSave, aclSetuser, aclUsers, aclWhoami
-
Methods inherited from interface io.lettuce.core.cluster.api.reactive.RedisClusterReactiveCommands
asking, clusterAddSlots, clusterAddSlotsRange, clusterBumpepoch, clusterCountFailureReports, clusterCountKeysInSlot, clusterDelSlots, clusterDelSlotsRange, clusterFailover, clusterFailover, clusterFlushslots, clusterForget, clusterGetKeysInSlot, clusterInfo, clusterKeyslot, clusterMeet, clusterMyId, clusterNodes, clusterReplicas, clusterReplicate, clusterReset, clusterSaveconfig, clusterSetConfigEpoch, clusterSetSlotImporting, clusterSetSlotMigrating, clusterSetSlotNode, clusterSetSlotStable, clusterShards, clusterSlaves, clusterSlots, readOnly, readWrite, setTimeout
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisFunctionReactiveCommands
fcall, fcall, fcallReadOnly, fcallReadOnly, functionDump, functionFlush, functionKill, functionList, functionList, functionLoad, functionLoad, functionRestore, functionRestore
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisGeoReactiveCommands
geoadd, geoadd, geoadd, geoadd, geoadd, geoadd, geodist, geohash, geopos, georadius, georadius, georadius, georadiusbymember, georadiusbymember, georadiusbymember, geosearch, geosearch, geosearchstore
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisHashReactiveCommands
hdel, hexists, hget, hgetall, hgetall, hincrby, hincrbyfloat, hkeys, hkeys, hlen, hmget, hmget, hmset, hrandfield, hrandfield, hrandfieldWithvalues, hrandfieldWithvalues, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hscan, hset, hset, hsetnx, hstrlen, hvals, hvals
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisHLLReactiveCommands
pfadd, pfcount, pfmerge
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisKeyReactiveCommands
copy, copy, del, dump, exists, expire, expire, expire, expire, expireat, expireat, expireat, expireat, expireat, expireat, expiretime, keys, keys, migrate, migrate, move, objectEncoding, objectFreq, objectIdletime, objectRefcount, persist, pexpire, pexpire, pexpire, pexpire, pexpireat, pexpireat, pexpireat, pexpireat, pexpireat, pexpireat, pexpiretime, pttl, randomkey, rename, renamenx, restore, restore, scan, scan, scan, scan, scan, scan, scan, scan, sort, sort, sort, sort, sortReadOnly, sortReadOnly, sortReadOnly, sortReadOnly, sortStore, touch, ttl, type, unlink
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisListReactiveCommands
blmove, blmove, blmpop, blmpop, blpop, blpop, brpop, brpop, brpoplpush, brpoplpush, lindex, linsert, llen, lmove, lmpop, lpop, lpop, lpos, lpos, lpos, lpos, lpush, lpushx, lrange, lrange, lrem, lset, ltrim, rpop, rpop, rpoplpush, rpush, rpushx
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisReactiveCommands
auth, auth, select, swapdb
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisScriptingReactiveCommands
digest, digest, eval, eval, eval, eval, evalReadOnly, evalsha, evalsha, evalshaReadOnly, scriptExists, scriptFlush, scriptFlush, scriptKill, scriptLoad, scriptLoad
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisServerReactiveCommands
bgrewriteaof, bgsave, clientCaching, clientGetname, clientGetredir, clientId, clientInfo, clientKill, clientKill, clientList, clientList, clientNoEvict, clientPause, clientSetinfo, clientSetname, clientTracking, clientUnblock, command, commandCount, commandInfo, commandInfo, configGet, configGet, configResetstat, configRewrite, configSet, configSet, dbsize, debugCrashAndRecover, debugHtstats, debugObject, debugOom, debugReload, debugRestart, debugSdslen, debugSegfault, flushall, flushall, flushallAsync, flushdb, flushdb, flushdbAsync, info, info, lastsave, memoryUsage, replicaof, replicaofNoOne, save, shutdown, shutdown, slaveof, slaveofNoOne, slowlogGet, slowlogGet, slowlogLen, slowlogReset, time
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisSetReactiveCommands
sadd, scard, sdiff, sdiff, sdiffstore, sinter, sinter, sintercard, sintercard, sinterstore, sismember, smembers, smembers, smismember, smove, spop, spop, srandmember, srandmember, srandmember, srem, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sscan, sunion, sunion, sunionstore
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisSortedSetReactiveCommands
bzmpop, bzmpop, bzmpop, bzmpop, bzpopmax, bzpopmax, bzpopmin, bzpopmin, zadd, zadd, zadd, zadd, zadd, zadd, zaddincr, zaddincr, zcard, zcount, zcount, zcount, zdiff, zdiffstore, zdiffWithScores, zincrby, zinter, zinter, zintercard, zintercard, zinterstore, zinterstore, zinterWithScores, zinterWithScores, zlexcount, zlexcount, zmpop, zmpop, zmscore, zpopmax, zpopmax, zpopmin, zpopmin, zrandmember, zrandmember, zrandmemberWithScores, zrandmemberWithScores, 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, zrangestore, zrangestorebylex, zrangestorebyscore, zrangeWithScores, zrangeWithScores, zrank, zrankWithScore, 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, zrevrangestore, zrevrangestorebylex, zrevrangestorebyscore, zrevrangeWithScores, zrevrangeWithScores, zrevrank, zrevrankWithScore, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscan, zscore, zunion, zunion, zunionstore, zunionstore, zunionWithScores, zunionWithScores
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisStreamReactiveCommands
xack, xadd, xadd, xadd, xadd, xautoclaim, xclaim, xclaim, xdel, xgroupCreate, xgroupCreate, xgroupCreateconsumer, xgroupDelconsumer, xgroupDestroy, xgroupSetid, xinfoConsumers, xinfoGroups, xinfoStream, xlen, xpending, xpending, xpending, xpending, xrange, xrange, xread, xread, xreadgroup, xreadgroup, xrevrange, xrevrange, xtrim, xtrim, xtrim
-
Methods inherited from interface io.lettuce.core.api.reactive.RedisStringReactiveCommands
append, bitcount, bitcount, bitfield, bitopAnd, bitopNot, bitopOr, bitopXor, bitpos, bitpos, bitpos, decr, decrby, get, getbit, getdel, getex, getrange, getset, incr, incrby, incrbyfloat, mget, mget, mset, msetnx, psetex, set, set, setbit, setex, setGet, setGet, setnx, setrange, stralgoLcs, strlen
-
-
-
-
Constructor Detail
-
RedisPubSubReactiveCommandsImpl
public RedisPubSubReactiveCommandsImpl(StatefulRedisPubSubConnection<K,V> connection, RedisCodec<K,V> codec)
Initialize a new connection.- Parameters:
connection
- the connection .codec
- Codec used to encode/decode keys and values.
-
-
Method Detail
-
observePatterns
public Flux<PatternMessage<K,V>> observePatterns()
Description copied from interface:RedisPubSubReactiveCommands
Flux for messages (pmessage) received though pattern subscriptions. The connection needs to be subscribed to one or more patterns usingRedisPubSubReactiveCommands.psubscribe(Object[])
.Warning! This method uses
FluxSink.OverflowStrategy.BUFFER
This does unbounded buffering and may lead toOutOfMemoryError
. UseRedisPubSubReactiveCommands.observePatterns(FluxSink.OverflowStrategy)
to specify a different strategy.- Specified by:
observePatterns
in interfaceRedisPubSubReactiveCommands<K,V>
- Returns:
- hot Flux for subscriptions to pmessage's.
-
observePatterns
public Flux<PatternMessage<K,V>> observePatterns(FluxSink.OverflowStrategy overflowStrategy)
Description copied from interface:RedisPubSubReactiveCommands
Flux for messages (pmessage) received though pattern subscriptions. The connection needs to be subscribed to one or more patterns usingRedisPubSubReactiveCommands.psubscribe(Object[])
.- Specified by:
observePatterns
in interfaceRedisPubSubReactiveCommands<K,V>
- Parameters:
overflowStrategy
- the overflow strategy to use.- Returns:
- hot Flux for subscriptions to pmessage's.
-
observeChannels
public Flux<ChannelMessage<K,V>> observeChannels()
Description copied from interface:RedisPubSubReactiveCommands
Flux for messages (message) received though channel subscriptions. The connection needs to be subscribed to one or more channels usingRedisPubSubReactiveCommands.subscribe(Object[])
.Warning! This method uses
FluxSink.OverflowStrategy.BUFFER
This does unbounded buffering and may lead toOutOfMemoryError
. UseRedisPubSubReactiveCommands.observeChannels(FluxSink.OverflowStrategy)
to specify a different strategy.- Specified by:
observeChannels
in interfaceRedisPubSubReactiveCommands<K,V>
- Returns:
- hot Flux for subscriptions to message's.
-
observeChannels
public Flux<ChannelMessage<K,V>> observeChannels(FluxSink.OverflowStrategy overflowStrategy)
Description copied from interface:RedisPubSubReactiveCommands
Flux for messages (message) received though channel subscriptions. The connection needs to be subscribed to one or more channels usingRedisPubSubReactiveCommands.subscribe(Object[])
.- Specified by:
observeChannels
in interfaceRedisPubSubReactiveCommands<K,V>
- Parameters:
overflowStrategy
- the overflow strategy to use.- Returns:
- hot Flux for subscriptions to message's.
-
psubscribe
public Mono<Void> psubscribe(K... patterns)
Description copied from interface:RedisPubSubReactiveCommands
Listen for messages published to channels matching the given patterns. TheMono
completes without a result as soon as the pattern subscription is registered.- Specified by:
psubscribe
in interfaceRedisPubSubReactiveCommands<K,V>
- Parameters:
patterns
- the patterns.- Returns:
- Mono<Void> Mono for
psubscribe
command.
-
punsubscribe
public Mono<Void> punsubscribe(K... patterns)
Description copied from interface:RedisPubSubReactiveCommands
Stop listening for messages posted to channels matching the given patterns. TheMono
completes without a result as soon as the pattern subscription is unregistered.- Specified by:
punsubscribe
in interfaceRedisPubSubReactiveCommands<K,V>
- Parameters:
patterns
- the patterns.- Returns:
- Mono<Void> Mono for
punsubscribe
command.
-
subscribe
public Mono<Void> subscribe(K... channels)
Description copied from interface:RedisPubSubReactiveCommands
Listen for messages published to the given channels. TheMono
completes without a result as soon as the * subscription is registered.- Specified by:
subscribe
in interfaceRedisPubSubReactiveCommands<K,V>
- Parameters:
channels
- the channels.- Returns:
- Mono<Void> Mono for
subscribe
command.
-
unsubscribe
public Mono<Void> unsubscribe(K... channels)
Description copied from interface:RedisPubSubReactiveCommands
Stop listening for messages posted to the given channels. TheMono
completes without a result as soon as the subscription is unregistered.- Specified by:
unsubscribe
in interfaceRedisPubSubReactiveCommands<K,V>
- Parameters:
channels
- the channels.- Returns:
- Mono<Void> Mono for
unsubscribe
command.
-
publish
public Mono<Long> publish(K channel, V message)
Description copied from interface:BaseRedisReactiveCommands
Post a message to a channel.- Specified by:
publish
in interfaceBaseRedisReactiveCommands<K,V>
- Overrides:
publish
in classAbstractRedisReactiveCommands<K,V>
- Parameters:
channel
- the channel type: key.message
- the message type: value.- Returns:
- Long integer-reply the number of clients that received the message.
-
pubsubChannels
public Flux<K> pubsubChannels(K channel)
Description copied from interface:BaseRedisReactiveCommands
Lists the currently *active channels*.- Specified by:
pubsubChannels
in interfaceBaseRedisReactiveCommands<K,V>
- Overrides:
pubsubChannels
in classAbstractRedisReactiveCommands<K,V>
- Parameters:
channel
- the key.- Returns:
- K array-reply a list of active channels, optionally matching the specified pattern.
-
pubsubNumsub
public Mono<Map<K,Long>> pubsubNumsub(K... channels)
Description copied from interface:BaseRedisReactiveCommands
Returns the number of subscribers (not counting clients subscribed to patterns) for the specified channels.- Specified by:
pubsubNumsub
in interfaceBaseRedisReactiveCommands<K,V>
- Overrides:
pubsubNumsub
in classAbstractRedisReactiveCommands<K,V>
- Parameters:
channels
- channel keys.- Returns:
- array-reply a list of channels and number of subscribers for every channel.
-
getStatefulConnection
public StatefulRedisPubSubConnection<K,V> getStatefulConnection()
- Specified by:
getStatefulConnection
in interfaceRedisPubSubReactiveCommands<K,V>
- Specified by:
getStatefulConnection
in interfaceRedisReactiveCommands<K,V>
- Overrides:
getStatefulConnection
in classRedisReactiveCommandsImpl<K,V>
- Returns:
- the underlying connection.
-
-