use new sockets lib
This commit is contained in:
+5
-5
@@ -3103,7 +3103,7 @@ respectively), and contains thin wrappers around all Redis commands through 7.2.
|
||||
instantiate
|
||||
</div>
|
||||
<p class="sig">
|
||||
(Fn [Socket] Redis)
|
||||
(Fn [TcpStream] Redis)
|
||||
</p>
|
||||
<span>
|
||||
|
||||
@@ -4988,7 +4988,7 @@ respectively), and contains thin wrappers around all Redis commands through 7.2.
|
||||
instantiate
|
||||
</div>
|
||||
<p class="sig">
|
||||
(Fn [Redis, Socket] Redis)
|
||||
(Fn [Redis, TcpStream] Redis)
|
||||
</p>
|
||||
<span>
|
||||
|
||||
@@ -5008,7 +5008,7 @@ respectively), and contains thin wrappers around all Redis commands through 7.2.
|
||||
instantiate
|
||||
</div>
|
||||
<p class="sig">
|
||||
(Fn [(Ref Redis a), Socket] ())
|
||||
(Fn [(Ref Redis a), TcpStream] ())
|
||||
</p>
|
||||
<span>
|
||||
|
||||
@@ -5322,7 +5322,7 @@ respectively), and contains thin wrappers around all Redis commands through 7.2.
|
||||
instantiate
|
||||
</div>
|
||||
<p class="sig">
|
||||
(Fn [(Ref Redis a)] (Ref Socket a))
|
||||
(Fn [(Ref Redis a)] (Ref TcpStream a))
|
||||
</p>
|
||||
<span>
|
||||
|
||||
@@ -5824,7 +5824,7 @@ respectively), and contains thin wrappers around all Redis commands through 7.2.
|
||||
instantiate
|
||||
</div>
|
||||
<p class="sig">
|
||||
(Fn [Redis, (Ref (Fn [Socket] Socket a) b)] Redis)
|
||||
(Fn [Redis, (Ref (Fn [TcpStream] TcpStream a) b)] Redis)
|
||||
</p>
|
||||
<span>
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="../style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<a href="https://git.veitheller.de/carpentry/redis">
|
||||
<div class="logo">
|
||||
<img src="" alt="Logo">
|
||||
<div class="index">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="RESP.html">
|
||||
RESP
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="Redis.html">
|
||||
Redis
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h1>
|
||||
redis
|
||||
</h1>
|
||||
<p>is a Redis client library for Carp, supporting Redis 7.x.</p>
|
||||
<h2>Installation</h2>
|
||||
<pre><code>(load "https://git.veitheller.de/carpentry/redis.git@0.2.0")
|
||||
</code></pre>
|
||||
<h2>Example</h2>
|
||||
<pre><code>(defn main []
|
||||
(match (Redis.open "127.0.0.1")
|
||||
(Result.Success r)
|
||||
(do
|
||||
(println* &(Redis.set &r @"key" @"value"))
|
||||
(println* &(Redis.get &r @"key"))
|
||||
(println* &(Redis.lrange &r @"mylist" @"0" @"-1"))
|
||||
(match (Redis.get &r @"key")
|
||||
(Result.Success resp)
|
||||
(match resp
|
||||
(RESP.Str s) (println* "got: " &s)
|
||||
(RESP.Null) (println* "not found")
|
||||
_ (println* "unexpected type"))
|
||||
(Result.Error e) (println* "error: " &e))
|
||||
(Redis.close r))
|
||||
(Result.Error err) (IO.errorln &err)))
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user