hara.runtime.redis

all-redis-ports

added in 4.0

(all-redis-ports)

gets all active redis ports

client

added in 3.0

(client {:keys [id env], :as m})

creates and starts a redis client

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?

client?

added in 3.0

(client? obj)

checks that instance is a 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|)

generate-script

added in 4.0

(generate-script ptr)

generates a script given a pointer

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

list-notify

added in 3.0

(list-notify redis)

lists all notify listeners for a client

notify

added in 3.0

(notify redis id pattern handler)

notifications for a given client

psubscribe

added in 3.0

(psubscribe redis id pattern handler)

subscribes to a pattern on the cache

punsubscribe

added in 3.0

(punsubscribe redis id)

unsubscribes from the pattern

raw-compile

added in 4.0

(raw-compile ptr)

compiles a function as body and sha

start-redis-array

added in 4.0

(start-redis-array ports)

starts a redis array

stop-redis-array

added in 4.0

(stop-redis-array ports)

stops a redis array

subscribe

added in 3.0

(subscribe redis id channels handler)

subscribes to a channel on the cache

test:activate

test:client

added in 3.0

(test:client)

creates a test client on docker

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:deactivate

test:invoke

added in 4.0

(test:invoke ptr & args)

does a script call on a single test connection

test:req

added in 4.0

(test:req & args)

does a request on a single test connection

unnotify

added in 3.0

(unnotify redis id)

removes notifications for a given client

unsubscribe

added in 3.0

(unsubscribe redis id)

unsubscribes from a channel

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”]