[com.aravindbaskaran/redis-pubsub "0.1.0"] ; See CHANGELOG for details
A redis pubsub client with keep-alive heart beats on top of the awesome com.taoensso/carmine library.
The main purpose of this library is to address the dead connections on redis pubsub clients with no way to re-subscribe or keep alive. Related GH Issue - https://github.com/ptaoussanis/carmine/issues/15 Existing PR - https://github.com/ptaoussanis/carmine/pull/207
So until this gets merged into the main carmine library in some format, the world keeps spinning and the connections keep dying, hence the library
(require '[redis-pubsub.core :as pubsub])
(require '[taoensso.carmine :as car])
(pubsub/with-new-keepalive-pubsub-listener {}
{
"ps-foo" #(println %) ;handle channel ps-foo, arguments passed ["message" channel-name message-string]
"ps-baz" #(println %) ;handle channel ps-baz, arguments passed ["message" channel-name message-string]
"pubsub:ping" #(println %) ;callback on ping, arguments passed ["pong" "pubsub:ping"]
"pubsub:listener:fail" #(println %) ;callback on listener failures, arguments passed ["pubsub:error" "pubsub:listener:fail" exception-obj]
}
; subsrcibe to required channels
(car/subscribe "ps-foo" "ps-baz"))
(require '[redis-pubsub.core :as pubsub])
(pubsub/subscribe
{}
"ps-foo"
#(println %) ;handle channel ps-foo, arguments passed ["message" channel-name message-string]
)
Broader documentation of underlying carmine interfaces
Distributed under the [EPL v1.0] (same as Clojure).
Copyright © 2018- [Aravind Baskaran].
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close