The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as Layer from "effect/Layer"; |
| 2 | import { StreamSinkFromWriteStream } from "./StreamSinkBatch.ts"; |
| 3 | import { WriteStreamHttp } from "./WriteStreamHttp.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Implementation of the {@link StreamSink} service over the stream's HTTP ingest endpoint ({@link WriteStreamHttp}), authenticated with a scoped `Pipelines Send` API token bound into the host. The stream needs `http` enabled. |
| 7 | * ### Providing the Layer |
| 8 | * **Example:** Provide the sink layer |
| 9 | * ```typescript |
| 10 | * Effect.gen(function* () { |
| 11 | * const sink = yield* Cloudflare.Basin.StreamSink(PageViews); |
| 12 | * // ... |
| 13 | * }).pipe(Effect.provide(Cloudflare.Basin.StreamSinkHttp)); |
| 14 | * ``` |
| 15 | * |
| 16 | * @layer |
| 17 | * @provides Cloudflare.Pipelines.StreamSink |
| 18 | * @product Pipelines |
| 19 | * @category Storage & Databases |
| 20 | */ |
| 21 | export const StreamSinkHttp = StreamSinkFromWriteStream.pipe(Layer.provide(WriteStreamHttp)); |