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

main
ts 31 lines 857 Bytes
Raw
1 import type { ReadClient } 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 read access (`get`, `ping`).
8 *
9 * `ReadRedis` is the Context tag, the type, and the callable —
10 * `yield* Railway.ReadRedis(Cache)`. Provide {@link ReadRedisHttp}.
11 *
12 *
13 * ### Read
14 * **Example:** Get a key
15 * ```typescript
16 * const cache = yield* Railway.ReadRedis(Cache);
17 * const value = yield* cache.get("marker");
18 * ```
19 *
20 * @binding
21 * @product Redis
22 */
23 export interface ReadRedis extends Binding.Service<
24 ReadRedis,
25 "Railway.ReadRedis",
26 (redis: Redis) => Effect.Effect<ReadRedisClient>
27 > {}
28
29 export const ReadRedis = Binding.Service<ReadRedis>("Railway.ReadRedis");
30
31 export type ReadRedisClient = ReadClient;