Liking cljdoc? Tell your friends :D

carmine-sentinel.core


add-sentinel-groups!clj

(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.
sourceraw docstring

get-sentinel-redis-specclj

(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.
sourceraw docstring

notify-event-listenersclj

(notify-event-listeners event)
source

register-listener!clj

(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}}}
sourceraw docstring

remove-last-resolved-spec!clj

(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.
sourceraw docstring

remove-sentinel-group!clj

(remove-sentinel-group! group-name)

Remove a sentinel group configuration by name.

Remove a sentinel group configuration by name.
sourceraw docstring

sentinel-get-master-addr-by-nameclj

(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)
sourceraw docstring

sentinel-sentinelsclj

(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)
sourceraw docstring

sentinel-slavesclj

(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)
sourceraw docstring

set-sentinel-groups!clj

(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.
sourceraw docstring

sync-onclj/smacro

(sync-on sg mn & body)
source

unregister-listener!clj

(unregister-listener! listener)

Remove the listener for switching master.

Remove the listener for switching master.
sourceraw docstring

update-conn-specclj

(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.
sourceraw docstring

wcarclj/smacro

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close