Skip to main content
Glama
workerService.ts1.38 kB
/** * Worker service that enables the embedded pipeline worker functionality. * This service starts the pipeline and configures it for background job processing. */ import type { IPipeline } from "../pipeline/trpc/interfaces"; import { logger } from "../utils/logger"; /** * Register worker service to enable embedded pipeline processing. * This starts the pipeline and configures callbacks for job processing. * * Note: This function is now deprecated in favor of configuring callbacks * in AppServer.setupPipelineEventBridge(). Keeping telemetry/logging here * would overwrite the event bus callbacks, breaking SSE notifications. * Telemetry and logging should be integrated into the event bus listeners instead. */ export async function registerWorkerService(pipeline: IPipeline): Promise<void> { // DO NOT call pipeline.setCallbacks() here - it would overwrite the callbacks // set by AppServer.setupPipelineEventBridge() that emit to the event bus. // All callbacks (including telemetry/logging) should be configured in one place. // Start the pipeline for job processing await pipeline.start(); logger.debug("Worker service started"); } /** * Stop the worker service and cleanup resources. */ export async function stopWorkerService(pipeline: IPipeline): Promise<void> { await pipeline.stop(); logger.debug("Worker service stopped"); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arabold/docs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server