Redis-backed IPubSubManager: topic subscriptions in Redis sets so they are visible cluster-wide.
Keys (optionally prefixed): topic:{t} -> SET of connection-id strings conn:{id} -> SET of topic strings (reverse index)
subscribe / unsubscribe apply both SADD/SREM atomically in a MULTI/EXEC. No explicit DEL on topic sets: Redis auto-removes a set key when its last member is removed, so empty topics disappear and the check-then-act DEL race cannot occur.
Redis-backed IPubSubManager: topic subscriptions in Redis sets so they are
visible cluster-wide.
Keys (optionally prefixed):
topic:{t} -> SET of connection-id strings
conn:{id} -> SET of topic strings (reverse index)
subscribe / unsubscribe apply both SADD/SREM atomically in a MULTI/EXEC.
No explicit DEL on topic sets: Redis auto-removes a set key when its last
member is removed, so empty topics disappear and the check-then-act DEL race
cannot occur.(create-redis-pubsub-manager pool)(create-redis-pubsub-manager pool {:keys [prefix]})Create a Redis-backed IPubSubManager.
Args: pool - JedisPool instance opts - Optional map: :prefix - String prefix for all Redis keys (default: nil)
Create a Redis-backed IPubSubManager.
Args:
pool - JedisPool instance
opts - Optional map:
:prefix - String prefix for all Redis keys (default: nil)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |