hara.runtime.redis
client:create
added in 3.0
(client:create {:keys [id env mode host port], :as m})creates a redis client
(r/client:create {:id “localhost” :port 17001}) => r/client?
connection
added in 3.0
(connection {:keys [host port]})creates a connection
(def |c| (connection {:host “localhost” :port 4456})) (connection? |c|) => true
(connection:close |c|)
has-notify
added in 3.0
(has-notify redis id)checks that a given notify listener is installed
invoke-ptr-redis
added in 4.0
(invoke-ptr-redis redis ptr args)invokes the pointer in the redis context
psubscribe
added in 3.0
(psubscribe redis id pattern handler)subscribes to a pattern on the cache
subscribe
added in 3.0
(subscribe redis id channels handler)subscribes to a channel on the cache
test:config
added in 3.0
(test:config)creates a container and gets config
(test:config) => map?
test:connection
added in 3.0
(test:connection)(test:connection m)creates a test connection
(test:connection) => connection?
test:invoke
added in 4.0
(test:invoke ptr & args)does a script call on a single test connection
with-connection
macro
added in 3.0
(with-connection [conn opts] & body)creates a temporary connection and runs code
(with-connection conn {:port 17001} (cc/bulk conn (fn [] (cc/req conn “FLUSHDB”) (cc/req conn “SET” “TEST:A” 1) (cc/req conn “KEYS” “*”)) {})) => [“OK” “OK” “TEST:A”]
with-test:connection
macro
added in 3.0
(with-test:connection conn & body)creates an runs statements using a test connection
(with-connection conn {:port 17001} (cc/bulk conn (fn [] (cc/req conn “FLUSHDB”) (cc/req conn “SET” “TEST:A” 1) (cc/req conn “KEYS” “*”)) {})) => [“OK” “OK” “TEST:A”]