(leader-watch conn
{:keys [lock-delay node name checks behavior ttl] :as session}
k
leader-ch
{:keys [max-retry-wait query-params log] :as options})
Setup a leader election watch on a given key, sends a vector with [path true/false] when the election changes.
If you close the leader-ch, it releases leader for the key
Setup a leader election watch on a given key, sends a vector with [path true/false] when the election changes. If you close the leader-ch, it releases leader for the key
(long-poll conn spec ch {:as options})
Polls consul using spec and publishes results onto ch. Applies no throttling of requests towards consul except via ch.
Polls consul using spec and publishes results onto ch. Applies no throttling of requests towards consul except via ch.
(poll conn spec params)
Calls consul for the given spec passing params. Returns the exception if one occurs.
Calls consul for the given spec passing params. Returns the exception if one occurs.
(register-service conn service-definition update-ms)
Register a service and keeps sending a health check to Consul every update-ms
Register a service and keeps sending a health check to Consul every update-ms
(setup-watch conn
[watch-key path :as spec]
change-chan
{:keys [max-retry-wait query-params log] :as options})
Creates a watching channel and notifies changes to a change-chan channel
:query-params - the query params passed into the underlying service call :max-retry-wait - max interval before retying consul when a failure occurs. Defaults to 5s.
The watch will terminate when the change-chan output channel is closed or when resulting function is called
Creates a watching channel and notifies changes to a change-chan channel :query-params - the query params passed into the underlying service call :max-retry-wait - max interval before retying consul when a failure occurs. Defaults to 5s. The watch will terminate when the change-chan output channel is closed or when resulting function is called
(update-state new-config)
(update-state old-state new-config)
When called with new-config, creates a new state map. When called with old-state and new-config, old-state is updated with new-config.
When called with new-config, creates a new state map. When called with old-state and new-config, old-state is updated with new-config.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close