No matching definitions.

valkey/client

src/valkey/client.tur
defopaque

Client

(Client)

Valkey/Redis connection handle.

Since: 0.2.0

defn

client-connect

(client-connect [host : cstr port : int] :)

connect to a Valkey/Redis server over TCP.

hosthostname or IP address string
portTCP port number

(Result Client int) -- ok carries the Client handle; err carries 0 on failure. 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] :)

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

pathfilesystem path to the Unix domain socket

(Result Client int) -- ok carries the Client handle; err carries 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 : Client] :)

close a connection and free its resources.

cctx-ptr obtained from client-connect or client-connect-unix (ok-val).
Consumes the linear Client: its single legal consumption, so any
later use of the handle is rejected under -Xsubstructural.

void

(client-close c)

Since: VK0

defn

client-ping

(client-ping [^borrow c : Client] :)

send a PING command and verify the server responds.

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

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

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

Since: VK0