(add-sentinel-groups! conf)
Add sentinel groups,it will be merged into current conf: {:group-name {:specs [{ :host host :port port :password password :timeout-ms timeout-ms }, ...other sentinel instances...] :pool {<opts>}}} The conf is a map of sentinel group to connection spec.
Add sentinel groups,it will be merged into current conf: {:group-name {:specs [{ :host host :port port :password password :timeout-ms timeout-ms }, ...other sentinel instances...] :pool {<opts>}}} The conf is a map of sentinel group to connection spec.
(get-sentinel-redis-spec sg
master-name
{:keys [prefer-slave? slaves-balancer]
:or {prefer-slave? false slaves-balancer first}
:as opts})
Get redis spec by sentinel-group and master name. If it is not resolved, it will query from sentinel and cache the result in memory. Recommend to call this function at your app startup to reduce resolving cost.
Get redis spec by sentinel-group and master name. If it is not resolved, it will query from sentinel and cache the result in memory. Recommend to call this function at your app startup to reduce resolving cost.
(register-listener! listener)
Register listener for switching master. The listener will be called with an event: {:event "+switch-master" :old {:host old-master-ip :port old-master-port :new {:host new-master-ip :port new-master-port}}}
Register listener for switching master. The listener will be called with an event: {:event "+switch-master" :old {:host old-master-ip :port old-master-port :new {:host new-master-ip :port new-master-port}}}
(remove-invalid-resolved-master-specs!)
Iterate all the resolved master specs and remove any invalid master spec found by checking role on redis. Please call this periodically to keep safe.
Iterate all the resolved master specs and remove any invalid master spec found by checking role on redis. Please call this periodically to keep safe.
(remove-last-resolved-spec! sg master-name)
Remove last resolved master spec by sentinel group and master name.
Remove last resolved master spec by sentinel group and master name.
(remove-sentinel-group! group-name)
Remove a sentinel group configuration by name.
Remove a sentinel group configuration by name.
(sentinel-get-master-addr-by-name name)
SENTINEL get-master-addr-by-name name
get master address by master name..
Available since: .
Time complexity: O(1)
SENTINEL get-master-addr-by-name name get master address by master name.. Available since: . Time complexity: O(1)
(sentinel-sentinels name)
SENTINEL sentinels name
get sentinel instances by mater name..
Available since: .
Time complexity: O(1)
SENTINEL sentinels name get sentinel instances by mater name.. Available since: . Time complexity: O(1)
(sentinel-slaves name)
SENTINEL slaves name
get slaves address by master name..
Available since: .
Time complexity: O(1)
SENTINEL slaves name get slaves address by master name.. Available since: . Time complexity: O(1)
(set-sentinel-groups! conf)
Configure sentinel groups, it will replace current conf: {:group-name {:specs [{ :host host :port port :password password :timeout-ms timeout-ms }, ...other sentinel instances...] :pool {<opts>}}} The conf is a map of sentinel group to connection spec.
Configure sentinel groups, it will replace current conf: {:group-name {:specs [{ :host host :port port :password password :timeout-ms timeout-ms }, ...other sentinel instances...] :pool {<opts>}}} The conf is a map of sentinel group to connection spec.
(unregister-listener! listener)
Remove the listener for switching master.
Remove the listener for switching master.
(update-conn-spec conn)
Cast a carmine-sentinel conn to carmine raw conn spec. It will resolve master from sentinel first time,then cache the result in memory for reusing.
Cast a carmine-sentinel conn to carmine raw conn spec. It will resolve master from sentinel first time,then cache the result in memory for reusing.
(wcar conn & body)
(wcar conn :as-pipeline & body)
It's the same as taoensso.carmine/wcar, but supports :master-name "mymaster" :sentinel-group :default in conn for redis sentinel cluster.
It's the same as taoensso.carmine/wcar, but supports :master-name "mymaster" :sentinel-group :default in conn for redis sentinel cluster.
(with-new-pubsub-listener conn-spec & others)
It's the same as taoensso.carmine/with-new-pubsub-listener, but supports :master-name "mymaster" :sentinel-group :default in conn for redis sentinel cluster.
Please note that you can only pass connection spec like hostname and port to taoensso.carmine/with-new-pubsub-listener like:
(taoensso.carmine/with-new-pubsub-listener {:host "127.0.0.1" :port 6379} {... channel and handler stuff ... } ... publish and subscribe stuff ... )
but for with-new-pubsub-listener in carmine-sentinel, you need to wrap connection spec with another layer along with master-name and sentinel-group to take advantage of sentinel cluster like:
(carmine-sentinel/with-new-pubsub-listener {:spec {:host "127.0.0.1" :port 6379} :master-name "mymaster" :sentinel-group :default} {... channel and handler stuff ... } ... publish and subscribe stuff ... )
It's the same as taoensso.carmine/with-new-pubsub-listener, but supports :master-name "mymaster" :sentinel-group :default in conn for redis sentinel cluster. Please note that you can only pass connection spec like hostname and port to taoensso.carmine/with-new-pubsub-listener like: (taoensso.carmine/with-new-pubsub-listener {:host "127.0.0.1" :port 6379} {... channel and handler stuff ... } ... publish and subscribe stuff ... ) but for with-new-pubsub-listener in carmine-sentinel, you need to wrap connection spec with another layer along with master-name and sentinel-group to take advantage of sentinel cluster like: (carmine-sentinel/with-new-pubsub-listener {:spec {:host "127.0.0.1" :port 6379} :master-name "mymaster" :sentinel-group :default} {... channel and handler stuff ... } ... publish and subscribe stuff ... )
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close