File
Blob: src/worker/index.ts
| 1 | import { Sandbox } from "@cloudflare/sandbox"; |
| 2 | import { handleQueueBatch } from "@/worker/dispatch/queue/consumer"; |
| 3 | import { RunWorkflows } from "@/worker/dispatch/workflows"; |
| 4 | import { ProjectDO, RunDO } from "@/worker/durable"; |
| 5 | import { app } from "@/worker/router"; |
| 6 | import type { RunQueueMessage } from "@/worker/contracts"; |
| 7 | |
| 8 | const handler: ExportedHandler<Env, RunQueueMessage> = { |
| 9 | async fetch(request, env, context) { |
| 10 | return await app.fetch(request, env, context); |
| 11 | }, |
| 12 | |
| 13 | async queue(batch, env) { |
| 14 | await handleQueueBatch(batch, env); |
| 15 | }, |
| 16 | }; |
| 17 | |
| 18 | export { ProjectDO, RunDO, RunWorkflows, Sandbox }; |
| 19 | export default handler; |