No matching definitions.

valkey/client

src/valkey/client.tur
defn

client-connect

(client-connect [host :cstr port :int] :ptr<void>)

connect to a Valkey/Redis server over TCP.

hosthostname or IP address string
portTCP port number

(ok ctx-ptr) on success; (err 0) on failure. ctx-ptr is an opaque :int handle; pass to cmd/reply/pubsub functions. Call client-close when done.

(let [r (client-connect "127.0.0.1" 6379)]
    (if (ok? r) (let [c (ok-val r)] ...) (println "connect failed")))

Since: VK0

defn

client-connect-unix

(client-connect-unix [path :cstr] :ptr<void>)

connect to a Valkey/Redis server over a Unix socket.

pathfilesystem path to the Unix domain socket

(ok ctx-ptr) on success; (err 0) on failure.

(let [r (client-connect-unix "/tmp/valkey.sock")]
    (if (ok? r) (let [c (ok-val r)] ...) (println "connect failed")))

Since: VK0

defn

client-close

(client-close [c :int] :void)

close a connection and free its resources.

cctx-ptr obtained from client-connect or client-connect-unix (ok-val)

void

(client-close c)

Since: VK0

defn

client-ping

(client-ping [c :int] :ptr<void>)

send a PING command and verify the server responds.

cctx-ptr (ok-val from client-connect)

(ok 0) if the server replies with a status reply; (err 0) otherwise.

(let [r (client-ping c)]
    (if (ok? r) (println "pong") (println "ping failed")))

Since: VK0

Internal definitions
__ok-- create an ok result wrapping integer value v.
__err-- create an err result wrapping integer error value e.