effect-redis 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -17
- package/dist/index.js +1 -1
- package/dist/redis/streams.d.ts +1 -1
- package/package.json +45 -46
- package/src/index.ts +5 -5
- package/src/redis/connection.ts +91 -91
- package/src/redis/core.ts +701 -701
- package/src/redis/errors.ts +118 -118
- package/src/redis/index.ts +61 -61
- package/src/redis/layers.ts +19 -19
- package/src/redis/persistence.ts +119 -119
- package/src/redis/pubsub.ts +94 -94
- package/src/redis/streams.ts +290 -290
- package/src/redis.ts +2 -2
- package/src/types.ts +163 -163
package/README.md
CHANGED
|
@@ -26,20 +26,17 @@ import {
|
|
|
26
26
|
RedisConnectionOptionsLive,
|
|
27
27
|
RedisLive,
|
|
28
28
|
RedisPubSubLive,
|
|
29
|
-
RedisPersistenceLive,
|
|
30
29
|
Redis,
|
|
31
30
|
RedisPubSub,
|
|
32
|
-
RedisPersistence,
|
|
33
31
|
} from "effect-redis";
|
|
34
32
|
|
|
35
33
|
const program = Effect.gen(function* () {
|
|
36
34
|
const redis = yield* Redis;
|
|
37
35
|
const pubsub = yield* RedisPubSub;
|
|
38
|
-
const storage = yield* RedisPersistence;
|
|
39
36
|
|
|
40
37
|
// Key-Value operations
|
|
41
|
-
yield*
|
|
42
|
-
const val = yield*
|
|
38
|
+
yield* redis.set("user:42", JSON.stringify({ name: "Ada" }));
|
|
39
|
+
const val = yield* redis.get("user:42");
|
|
43
40
|
|
|
44
41
|
// Core commands
|
|
45
42
|
yield* redis.set("counter", "1");
|
|
@@ -61,8 +58,7 @@ const RedisLayer = RedisConnectionOptionsLive({
|
|
|
61
58
|
url: "redis://localhost:6379",
|
|
62
59
|
}).pipe(
|
|
63
60
|
Layer.provideMerge(RedisLive),
|
|
64
|
-
Layer.provideMerge(RedisPubSubLive)
|
|
65
|
-
Layer.provideMerge(RedisPersistenceLive)
|
|
61
|
+
Layer.provideMerge(RedisPubSubLive)
|
|
66
62
|
);
|
|
67
63
|
|
|
68
64
|
Effect.runPromise(program.pipe(Effect.provide(RedisLayer)));
|
|
@@ -78,7 +74,6 @@ The library is organized into several services, all of which can share a single
|
|
|
78
74
|
| :--- | :--- | :--- |
|
|
79
75
|
| `Redis` | `RedisLive` | Comprehensive Redis commands (Get, Set, Hash, List, etc.) |
|
|
80
76
|
| `RedisPubSub` | `RedisPubSubLive` | Specialized Pub/Sub operations |
|
|
81
|
-
| `RedisPersistence` | `RedisPersistenceLive` | **Deprecated**: Use `Redis` service instead. Will be removed soon. |
|
|
82
77
|
| `RedisStream` | `RedisStreamLive` | Redis Streams operations (XADD, XREAD, XRANGE, etc.) |
|
|
83
78
|
| `RedisConnection` | `RedisConnectionLive` | The underlying shared connection manager |
|
|
84
79
|
|
|
@@ -121,15 +116,6 @@ The most comprehensive service, wrapping hundreds of Redis commands.
|
|
|
121
116
|
- `subscribe(key, options?)` -> Returns `Stream<StreamEntry>` (continuous polling)
|
|
122
117
|
- `xack(key, group, ...ids)`
|
|
123
118
|
|
|
124
|
-
### `RedisPersistence` Service (**Deprecated**)
|
|
125
|
-
> **Note**: This service is being substituted by the `Redis` service and will be removed in a future version. Please migrate to the `Redis` service for all key-value operations.
|
|
126
|
-
|
|
127
|
-
A simplified service for basic storage needs.
|
|
128
|
-
- `setValue(key, value)`
|
|
129
|
-
- `getValue(key)`
|
|
130
|
-
- `del(key)`
|
|
131
|
-
- `exists(key)`
|
|
132
|
-
- `sAdd(key, members)`
|
|
133
119
|
|
|
134
120
|
---
|
|
135
121
|
|