@taskcast/redis 0.1.1 → 0.1.2
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 +43 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @taskcast/redis
|
|
2
|
+
|
|
3
|
+
Redis adapters for [Taskcast](https://github.com/weightwave/taskcast) — real-time broadcast via pub/sub and short-term event/task storage.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @taskcast/redis ioredis
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { TaskEngine } from '@taskcast/core'
|
|
15
|
+
import { createRedisAdapters } from '@taskcast/redis'
|
|
16
|
+
import Redis from 'ioredis'
|
|
17
|
+
|
|
18
|
+
const { broadcast, shortTermStore } = createRedisAdapters({
|
|
19
|
+
pubClient: new Redis(process.env.REDIS_URL),
|
|
20
|
+
subClient: new Redis(process.env.REDIS_URL),
|
|
21
|
+
storeClient: new Redis(process.env.REDIS_URL),
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const engine = new TaskEngine({
|
|
25
|
+
broadcast,
|
|
26
|
+
shortTermStore,
|
|
27
|
+
})
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Adapters
|
|
31
|
+
|
|
32
|
+
- **`RedisBroadcastProvider`** — Real-time event fan-out via Redis pub/sub
|
|
33
|
+
- **`RedisShortTermStore`** — Event buffer and task state storage via Redis
|
|
34
|
+
|
|
35
|
+
Both adapters are created together with `createRedisAdapters()`, which requires three separate Redis connections (pub, sub, store).
|
|
36
|
+
|
|
37
|
+
## Part of Taskcast
|
|
38
|
+
|
|
39
|
+
This is the Redis adapter package. See the [Taskcast monorepo](https://github.com/weightwave/taskcast) for the full project.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
[MIT](https://github.com/weightwave/taskcast/blob/main/LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taskcast/redis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Redis broadcast + short-term store adapters for Taskcast.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"ioredis": "^5.4.0",
|
|
32
|
-
"@taskcast/core": "0.1.
|
|
32
|
+
"@taskcast/core": "0.1.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "^5.7.0",
|