inngest
Version:
Official SDK for Inngest.com. Inngest is the reliability layer for modern applications. Inngest combines durable execution, events, and queues into a zero-infra platform with built-in observability.
1 lines • 2.68 kB
Source Map (JSON)
{"version":3,"file":"types.cjs","names":[],"sources":["../../../src/components/connect/types.ts"],"sourcesContent":["import type { RegisterOptions } from \"../../types.ts\";\nimport type { Inngest } from \"../Inngest.ts\";\nimport type { InngestFunction } from \"../InngestFunction.ts\";\n\nexport const DEFAULT_SHUTDOWN_SIGNALS = [\"SIGINT\", \"SIGTERM\"];\n\nexport interface ConnectApp {\n client: Inngest.Any;\n functions?: Array<InngestFunction.Like>;\n}\n\nexport interface ConnectHandlerOptions extends RegisterOptions {\n apps: ConnectApp[];\n\n /**\n * InstanceId represents a stable identifier to be used for identifying connected SDKs.\n * This can be a hostname or other identifier that remains stable across restarts.\n *\n * If nil, this defaults to the current machine's hostname.\n */\n instanceId?: string;\n\n /**\n * MaxWorkerConcurrency represents the maximum number of worker concurrency to use.\n *\n * If left undefined, there will be no limit on the number of concurrent requests on the worker.\n */\n maxWorkerConcurrency?: number;\n\n /**\n * By default, connections will be gracefully shut down when the current\n * process receives a SIGINT or SIGTERM signal. Set this to an empty array to disable this behavior.\n */\n handleShutdownSignals?: string[];\n\n /**\n * Override the gateway WebSocket endpoint. When set, this URL is used\n * instead of the endpoint returned by the Inngest API.\n *\n * Useful when there is a proxy between the worker and the gateway\n * that requires a different hostname (e.g. `ws://localhost:8100`).\n *\n * Can also be set via the `INNGEST_CONNECT_GATEWAY_URL` environment variable.\n * This option takes precedence over the env var.\n */\n gatewayUrl?: string;\n\n /**\n * Enable running the WebSocket connection, heartbeater, and lease extender\n * in a separate worker thread. This prevents thread-blocking user code from\n * interfering with connection health.\n *\n * Only works in environments that support worker_threads.\n *\n * Can also be disabled via the INNGEST_CONNECT_ISOLATE_EXECUTION=false environment variable.\n *\n * @default true\n */\n isolateExecution?: boolean;\n}\n\nexport interface WorkerConnection {\n connectionId: string;\n closed: Promise<void>;\n close: () => Promise<void>;\n state: ConnectionState;\n}\n\nexport enum ConnectionState {\n CONNECTING = \"CONNECTING\",\n ACTIVE = \"ACTIVE\",\n PAUSED = \"PAUSED\",\n RECONNECTING = \"RECONNECTING\",\n CLOSING = \"CLOSING\",\n CLOSED = \"CLOSED\",\n}\n"],"mappings":";;AAIA,MAAa,2BAA2B,CAAC,UAAU,UAAU;AAgE7D,IAAY,8DAAL;AACL;AACA;AACA;AACA;AACA;AACA"}