Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ An experimental implementation of redis client for deno

## Usage

**Installation**
### Installation

```shell
$ deno add jsr:@db/redis
```

**Permissions**
### Permissions

`deno-redis` needs `--allow-net` privilege

**Stateless Commands**
### Stateless Commands

```ts
import { connect } from "@db/redis";
Expand All @@ -31,7 +31,7 @@ const ok = await redis.set("hoge", "fuga");
const fuga = await redis.get("hoge");
```

**PubSub**
### Pub/Sub

```ts
import { connect } from "@db/redis";
Expand All @@ -45,7 +45,7 @@ const sub = await redis.subscribe("channel");
})();
```

**Streams**
### Streams

```ts
import { connect } from "@db/redis";
Expand All @@ -68,7 +68,7 @@ const plz = msgFV["yes"];
const thx = msgFV["no"];
```

**Cluster**
### Cluster

First, if you need to set up nodes into a working redis cluster:

Expand Down Expand Up @@ -205,6 +205,26 @@ const sub = await cacheClient.subscribe<string[]>("__redis__:invalidate");
})();
```

### Connection pooling

> [!WARNING]
> This feature is still experimental and may change in the future.

`@db/redis/experimental/pool` module provides connection pooling:

```typescript
import { createPoolClient } from "@db/redis/experimental/pool";

const redis = await createPoolClient({
connection: {
hostname: "127.0.0.1",
port: 6379,
},
});
await redis.set("foo", "bar");
await redis.get("foo");
```

### Experimental features

deno-redis provides some experimental features.
Expand Down
Loading