net.resp.connection
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|)
connection:health
added in 3.0
(connection:health connection)checks on the health of the connection
(connection:health |conn|) => {:status :ok}
connection:process-bulk
added in 3.0
(connection:process-bulk connection inputs outputs _)processes the returned responses
connection:process-single
added in 3.0
(connection:process-single _ data {:keys [format deserialize string]})processes output data
connection:request-bulk
added in 3.0
(connection:request-bulk connection commands)(connection:request-bulk connection commands _)sends a multi command to the connection
connection:request-single
added in 3.0
(connection:request-single connection command)(connection:request-single connection command _)requests the connection command
connection:started?
added in 3.0
(connection:started? connection)checks that connection has started
connection:stopped?
added in 3.0
(connection:stopped? connection)checks that connection has stopped
connection:throw
added in 3.0
(connection:throw connection t)writes an exception to the connection
connection:transact-combine
added in 3.0
(connection:transact-combine _ data)not valid for rdp protocol
connection:transact-end
added in 3.0
(connection:transact-end connection)command to end transaction
(connection:transact-end nil) => “EXEC”
connection:transact-start
added in 3.0
(connection:transact-start connection)command to start transaction
(connection:transact-start nil) => “MULTI”
connection:value
added in 3.0
(connection:value connection val)writes a string value to the connection
connection?
added in 3.0
(connection? obj)checks if instance is type connection
(connection? |conn|) => true
input-array
added in 3.0
(input-array command)protects against wrong inputs
(seq (input-array 1 2 3)) => ’(“1” “2” “3”)
pipeline:write
added in 3.0
(pipeline:write pipeline input)sends a request tot the pipeline
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?
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”]