feat(federation): Implement queue for fetches

This commit is contained in:
Jesse Wierzbinski 2024-11-25 20:29:59 +01:00
parent 79cf43d752
commit 5fc6c4dcfa
No known key found for this signature in database
7 changed files with 122 additions and 26 deletions

View file

@ -5,7 +5,7 @@ import { serveStatic } from "@hono/hono/bun";
import type { OpenAPIHono } from "@hono/zod-openapi";
import { config } from "~/packages/config-manager";
import type { HonoEnv } from "~/types/api";
import { deliveryQueue, inboxQueue } from "~/worker";
import { deliveryQueue, fetchQueue, inboxQueue } from "~/worker";
export const applyToHono = (app: OpenAPIHono<HonoEnv>): void => {
const serverAdapter = new HonoAdapter(serveStatic);
@ -14,6 +14,7 @@ export const applyToHono = (app: OpenAPIHono<HonoEnv>): void => {
queues: [
new BullMQAdapter(inboxQueue),
new BullMQAdapter(deliveryQueue),
new BullMQAdapter(fetchQueue),
],
serverAdapter,
options: {