@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 31 lines 851 Bytes
Raw
1 import type { WriteClient } from "@alchemy.run/redis";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Redis } from "./Redis.ts";
5
6 /**
7 * Bind a {@link Redis} database with write access (`set`, `del`).
8 *
9 * `WriteRedis` is the Context tag, the type, and the callable —
10 * `yield* Fly.WriteRedis(Cache)`. Provide {@link WriteRedisHttp}.
11 *
12 *
13 * ### Write
14 * **Example:** Set a key
15 * ```typescript
16 * const cache = yield* Fly.WriteRedis(Cache);
17 * yield* cache.set("marker", "hello");
18 * ```
19 *
20 * @binding
21 * @product Redis
22 */
23 export interface WriteRedis extends Binding.Service<
24 WriteRedis,
25 "Fly.WriteRedis",
26 (redis: Redis) => Effect.Effect<WriteRedisClient>
27 > {}
28
29 export const WriteRedis = Binding.Service<WriteRedis>("Fly.WriteRedis");
30
31 export type WriteRedisClient = WriteClient;