bunqueue-client 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +165 -0
- package/LEGACY.md +460 -0
- package/README.md +204 -349
- package/dist/ack-batcher.js +7 -67
- package/dist/canonical-manifest.json +934 -0
- package/dist/chunk-b967v3w3.js +79 -0
- package/dist/chunk-fekm0ma6.js +110 -0
- package/dist/chunk-jxkszwqp.js +573 -0
- package/dist/embedded.js +16510 -0
- package/dist/frame.js +14 -57
- package/dist/index.d.ts +1 -27
- package/dist/index.js +10953 -16
- package/dist/legacy.d.ts +1 -0
- package/dist/legacy.js +2081 -0
- package/dist/{ack-batcher.d.ts → types/sdk/typescript/src/ack-batcher.d.ts} +3 -3
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/aging.d.ts +2 -2
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/batch.d.ts +2 -2
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/bunqueue-api.d.ts +5 -5
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/bunqueue.d.ts +13 -13
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/circuit-breaker.d.ts +2 -2
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/dedup-debounce.d.ts +2 -2
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/dlq-rate-limit.d.ts +2 -2
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/rate-gate.d.ts +1 -1
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/retry.d.ts +1 -1
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/triggers.d.ts +3 -3
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/ttl.d.ts +1 -1
- package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/types.d.ts +4 -4
- package/dist/types/sdk/typescript/src/canonical-transport/bun-sqlite-types.d.ts +21 -0
- package/dist/{connection-pool.d.ts → types/sdk/typescript/src/connection-pool.d.ts} +1 -1
- package/dist/{connection-types.d.ts → types/sdk/typescript/src/connection-types.d.ts} +1 -1
- package/dist/{connection.d.ts → types/sdk/typescript/src/connection.d.ts} +6 -19
- package/dist/{errors.d.ts → types/sdk/typescript/src/errors.d.ts} +3 -0
- package/dist/types/sdk/typescript/src/flow-commit.d.ts +5 -0
- package/dist/types/sdk/typescript/src/flow-plan-legacy.d.ts +13 -0
- package/dist/types/sdk/typescript/src/flow-plan.d.ts +29 -0
- package/dist/{flow-types.d.ts → types/sdk/typescript/src/flow-types.d.ts} +7 -4
- package/dist/{flow.d.ts → types/sdk/typescript/src/flow.d.ts} +6 -10
- package/dist/{frame.d.ts → types/sdk/typescript/src/frame.d.ts} +1 -1
- package/dist/types/sdk/typescript/src/index.d.ts +10 -0
- package/dist/{job.d.ts → types/sdk/typescript/src/job.d.ts} +4 -3
- package/dist/types/sdk/typescript/src/legacy.d.ts +27 -0
- package/dist/{observability.d.ts → types/sdk/typescript/src/observability.d.ts} +14 -0
- package/dist/{queue-admin.d.ts → types/sdk/typescript/src/queue-admin.d.ts} +3 -4
- package/dist/{queue-control.d.ts → types/sdk/typescript/src/queue-control.d.ts} +5 -5
- package/dist/{queue-query.d.ts → types/sdk/typescript/src/queue-query.d.ts} +3 -3
- package/dist/{queue.d.ts → types/sdk/typescript/src/queue.d.ts} +8 -8
- package/dist/{responses.d.ts → types/sdk/typescript/src/responses.d.ts} +2 -2
- package/dist/types/sdk/typescript/src/serialization.d.ts +10 -0
- package/dist/{socket-factory.d.ts → types/sdk/typescript/src/socket-factory.d.ts} +1 -1
- package/dist/types/sdk/typescript/src/terminal-outcome.d.ts +8 -0
- package/dist/{types.d.ts → types/sdk/typescript/src/types.d.ts} +5 -2
- package/dist/{worker-base.d.ts → types/sdk/typescript/src/worker-base.d.ts} +6 -6
- package/dist/types/sdk/typescript/src/worker-slot-signal.d.ts +6 -0
- package/dist/{worker-types.d.ts → types/sdk/typescript/src/worker-types.d.ts} +3 -3
- package/dist/{worker.d.ts → types/sdk/typescript/src/worker.d.ts} +3 -2
- package/dist/types/src/application/background/dlq.d.ts +2 -0
- package/dist/types/src/application/background/lifecycle.d.ts +4 -0
- package/dist/types/src/application/background/recovery/active.d.ts +5 -0
- package/dist/types/src/application/background/recovery/index.d.ts +2 -0
- package/dist/types/src/application/background/recovery/pending.d.ts +3 -0
- package/dist/types/src/application/background/recovery/restore.d.ts +5 -0
- package/dist/types/src/application/background/recovery/shared.d.ts +6 -0
- package/dist/types/src/application/background/timeouts.d.ts +25 -0
- package/dist/types/src/application/backgroundTasks.d.ts +7 -0
- package/dist/types/src/application/cleanupTasks.d.ts +10 -0
- package/dist/types/src/application/clientOwnership.d.ts +65 -0
- package/dist/types/src/application/clientTracking.d.ts +40 -0
- package/dist/types/src/application/completedCleanup.d.ts +34 -0
- package/dist/types/src/application/completedRetry.d.ts +21 -0
- package/dist/types/src/application/contextFactory.d.ts +49 -0
- package/dist/types/src/application/dependencyCompletions.d.ts +63 -0
- package/dist/types/src/application/dependencyProcessor.d.ts +15 -0
- package/dist/types/src/application/dependencyResultTracker.d.ts +18 -0
- package/dist/types/src/application/dlqManager.d.ts +49 -0
- package/dist/types/src/application/dlqRetry.d.ts +12 -0
- package/dist/types/src/application/emptyQueueCleanup.d.ts +3 -0
- package/dist/types/src/application/eventsManager.d.ts +50 -0
- package/dist/types/src/application/flowFailureRecovery.d.ts +20 -0
- package/dist/types/src/application/flowParentBackpatch.d.ts +27 -0
- package/dist/types/src/application/jobLogsManager.d.ts +21 -0
- package/dist/types/src/application/latencyTracker.d.ts +39 -0
- package/dist/types/src/application/lockManager.d.ts +15 -0
- package/dist/types/src/application/lockOperations.d.ts +38 -0
- package/dist/types/src/application/metricsExporter.d.ts +27 -0
- package/dist/types/src/application/monitoringChecks.d.ts +36 -0
- package/dist/types/src/application/operations/ack/batch.d.ts +8 -0
- package/dist/types/src/application/operations/ack/completion.d.ts +3 -0
- package/dist/types/src/application/operations/ack/failure.d.ts +3 -0
- package/dist/types/src/application/operations/ack.d.ts +5 -0
- package/dist/types/src/application/operations/ackHelpers.d.ts +36 -0
- package/dist/types/src/application/operations/customId.d.ts +51 -0
- package/dist/types/src/application/operations/flowPush.d.ts +9 -0
- package/dist/types/src/application/operations/flowTopologyValidation.d.ts +3 -0
- package/dist/types/src/application/operations/flowValidation.d.ts +3 -0
- package/dist/types/src/application/operations/jobClaim.d.ts +17 -0
- package/dist/types/src/application/operations/jobManagement.d.ts +45 -0
- package/dist/types/src/application/operations/jobMoveOperations.d.ts +9 -0
- package/dist/types/src/application/operations/jobPromotion.d.ts +7 -0
- package/dist/types/src/application/operations/jobStateTransitions.d.ts +15 -0
- package/dist/types/src/application/operations/parentLink.d.ts +36 -0
- package/dist/types/src/application/operations/parentLinkInput.d.ts +8 -0
- package/dist/types/src/application/operations/pull.d.ts +20 -0
- package/dist/types/src/application/operations/pullFinalization.d.ts +6 -0
- package/dist/types/src/application/operations/pullStateTransition.d.ts +51 -0
- package/dist/types/src/application/operations/push.d.ts +13 -0
- package/dist/types/src/application/operations/pushAdmission.d.ts +36 -0
- package/dist/types/src/application/operations/pushBatch.d.ts +4 -0
- package/dist/types/src/application/operations/pushContext.d.ts +48 -0
- package/dist/types/src/application/operations/pushDeduplication.d.ts +42 -0
- package/dist/types/src/application/operations/pushInsert.d.ts +39 -0
- package/dist/types/src/application/operations/pushLocks.d.ts +15 -0
- package/dist/types/src/application/operations/query/collect.d.ts +12 -0
- package/dist/types/src/application/operations/query/jobLookup.d.ts +9 -0
- package/dist/types/src/application/operations/query/pagination.d.ts +8 -0
- package/dist/types/src/application/operations/query/state.d.ts +4 -0
- package/dist/types/src/application/operations/queryOperations.d.ts +5 -0
- package/dist/types/src/application/operations/queueControl.d.ts +50 -0
- package/dist/types/src/application/orphanRecovery.d.ts +25 -0
- package/dist/types/src/application/prometheusOperationalMetrics.d.ts +31 -0
- package/dist/types/src/application/queue-manager/ack.d.ts +23 -0
- package/dist/types/src/application/queue-manager/configuration.d.ts +27 -0
- package/dist/types/src/application/queue-manager/context.d.ts +5 -0
- package/dist/types/src/application/queue-manager/control.d.ts +20 -0
- package/dist/types/src/application/queue-manager/delivery.d.ts +33 -0
- package/dist/types/src/application/queue-manager/dependencies.d.ts +8 -0
- package/dist/types/src/application/queue-manager/dependency-runtime.d.ts +8 -0
- package/dist/types/src/application/queue-manager/flow-failures.d.ts +18 -0
- package/dist/types/src/application/queue-manager/flow-options.d.ts +8 -0
- package/dist/types/src/application/queue-manager/job-management.d.ts +17 -0
- package/dist/types/src/application/queue-manager/lifecycle.d.ts +4 -0
- package/dist/types/src/application/queue-manager/limits.d.ts +58 -0
- package/dist/types/src/application/queue-manager/locks.d.ts +21 -0
- package/dist/types/src/application/queue-manager/observability.d.ts +16 -0
- package/dist/types/src/application/queue-manager/queries.d.ts +24 -0
- package/dist/types/src/application/queue-manager/repeat.d.ts +4 -0
- package/dist/types/src/application/queue-manager/services.d.ts +19 -0
- package/dist/types/src/application/queue-manager/state.d.ts +98 -0
- package/dist/types/src/application/queue-manager/stats.d.ts +28 -0
- package/dist/types/src/application/queueManager.d.ts +5 -0
- package/dist/types/src/application/queueStatsAggregator.d.ts +23 -0
- package/dist/types/src/application/queueTelemetryJournal.d.ts +24 -0
- package/dist/types/src/application/repeatJobs.d.ts +7 -0
- package/dist/types/src/application/stallDetection.d.ts +26 -0
- package/dist/types/src/application/statsManager.d.ts +59 -0
- package/dist/types/src/application/taskErrorTracking.d.ts +22 -0
- package/dist/types/src/application/throughputTracker.d.ts +34 -0
- package/dist/types/src/application/types/ack.d.ts +136 -0
- package/dist/types/src/application/types/background.d.ts +18 -0
- package/dist/types/src/application/types/config.d.ts +41 -0
- package/dist/types/src/application/types/contextFactory.d.ts +89 -0
- package/dist/types/src/application/types/contexts.d.ts +117 -0
- package/dist/types/src/application/types/index.d.ts +7 -0
- package/dist/types/src/application/types/query.d.ts +23 -0
- package/dist/types/src/application/types/queueManager.d.ts +100 -0
- package/dist/types/src/application/webhookManager.d.ts +47 -0
- package/dist/types/src/application/workerManager.d.ts +61 -0
- package/dist/types/src/client/bunqueue/aging.d.ts +16 -0
- package/dist/types/src/client/bunqueue/batch.d.ts +16 -0
- package/dist/types/src/client/bunqueue/cancellation.d.ts +21 -0
- package/dist/types/src/client/bunqueue/circuitBreaker.d.ts +21 -0
- package/dist/types/src/client/bunqueue/dedupDebounce.d.ts +12 -0
- package/dist/types/src/client/bunqueue/dlqRateLimit.d.ts +26 -0
- package/dist/types/src/client/bunqueue/retry.d.ts +8 -0
- package/dist/types/src/client/bunqueue/runtime.d.ts +35 -0
- package/dist/types/src/client/bunqueue/triggers.d.ts +17 -0
- package/dist/types/src/client/bunqueue/ttl.d.ts +17 -0
- package/dist/types/src/client/bunqueue/types.d.ts +147 -0
- package/dist/types/src/client/bunqueue.d.ts +73 -0
- package/dist/types/src/client/dlqConversion.d.ts +5 -0
- package/dist/types/src/client/errors.d.ts +24 -0
- package/dist/types/src/client/events.d.ts +85 -0
- package/dist/types/src/client/flow.d.ts +70 -0
- package/dist/types/src/client/flowAtomic.d.ts +9 -0
- package/dist/types/src/client/flowJobCoreMethods.d.ts +28 -0
- package/dist/types/src/client/flowJobDependencies.d.ts +7 -0
- package/dist/types/src/client/flowJobFactory.d.ts +24 -0
- package/dist/types/src/client/flowJobMoveMethods.d.ts +16 -0
- package/dist/types/src/client/flowJobTypes.d.ts +29 -0
- package/dist/types/src/client/flowLegacyPlan.d.ts +16 -0
- package/dist/types/src/client/flowOptions.d.ts +10 -0
- package/dist/types/src/client/flowPlan.d.ts +16 -0
- package/dist/types/src/client/flowPush.d.ts +27 -0
- package/dist/types/src/client/flowReader.d.ts +10 -0
- package/dist/types/src/client/flowResults.d.ts +11 -0
- package/dist/types/src/client/flowTypes.d.ts +77 -0
- package/dist/types/src/client/forwarder.d.ts +75 -0
- package/dist/types/src/client/groupId.d.ts +1 -0
- package/dist/types/src/client/index.d.ts +46 -0
- package/dist/types/src/client/jobConversion.d.ts +10 -0
- package/dist/types/src/client/jobConversionHelpers.d.ts +28 -0
- package/dist/types/src/client/jobConversionTypes.d.ts +88 -0
- package/dist/types/src/client/jobDeduplication.d.ts +6 -0
- package/dist/types/src/client/jobHelpers.d.ts +31 -0
- package/dist/types/src/client/legacyConnectionOptions.d.ts +8 -0
- package/dist/types/src/client/manager.d.ts +15 -0
- package/dist/types/src/client/pro.d.ts +9 -0
- package/dist/types/src/client/queue/addBatcher.d.ts +59 -0
- package/dist/types/src/client/queue/bullmqCompat.d.ts +57 -0
- package/dist/types/src/client/queue/deduplication.d.ts +14 -0
- package/dist/types/src/client/queue/dlq.d.ts +61 -0
- package/dist/types/src/client/queue/dlqJobMethods.d.ts +9 -0
- package/dist/types/src/client/queue/dlqOps.d.ts +26 -0
- package/dist/types/src/client/queue/dlqStats.d.ts +3 -0
- package/dist/types/src/client/queue/failWire.d.ts +17 -0
- package/dist/types/src/client/queue/helpers.d.ts +19 -0
- package/dist/types/src/client/queue/job-proxy/dependencies.d.ts +9 -0
- package/dist/types/src/client/queue/job-proxy/reflection.d.ts +2 -0
- package/dist/types/src/client/queue/job-proxy/simple.d.ts +3 -0
- package/dist/types/src/client/queue/job-proxy/tcp.d.ts +4 -0
- package/dist/types/src/client/queue/jobMetadata.d.ts +10 -0
- package/dist/types/src/client/queue/jobMove.d.ts +32 -0
- package/dist/types/src/client/queue/jobProxy.d.ts +4 -0
- package/dist/types/src/client/queue/operations/add/bulk.d.ts +7 -0
- package/dist/types/src/client/queue/operations/add/payload.d.ts +25 -0
- package/dist/types/src/client/queue/operations/add/single.d.ts +3 -0
- package/dist/types/src/client/queue/operations/add.d.ts +2 -0
- package/dist/types/src/client/queue/operations/control.d.ts +42 -0
- package/dist/types/src/client/queue/operations/counts.d.ts +48 -0
- package/dist/types/src/client/queue/operations/groups.d.ts +24 -0
- package/dist/types/src/client/queue/operations/management.d.ts +51 -0
- package/dist/types/src/client/queue/operations/query.d.ts +50 -0
- package/dist/types/src/client/queue/operations/queryStates.d.ts +13 -0
- package/dist/types/src/client/queue/operations/queryTcpPages.d.ts +14 -0
- package/dist/types/src/client/queue/queue.d.ts +12 -0
- package/dist/types/src/client/queue/rateLimit.d.ts +46 -0
- package/dist/types/src/client/queue/runtime/compatibility.d.ts +13 -0
- package/dist/types/src/client/queue/runtime/configuration.d.ts +46 -0
- package/dist/types/src/client/queue/runtime/connection.d.ts +6 -0
- package/dist/types/src/client/queue/runtime/control.d.ts +41 -0
- package/dist/types/src/client/queue/runtime/queries.d.ts +66 -0
- package/dist/types/src/client/queue/runtime/scheduling.d.ts +33 -0
- package/dist/types/src/client/queue/runtime/state.d.ts +101 -0
- package/dist/types/src/client/queue/scheduler.d.ts +58 -0
- package/dist/types/src/client/queue/schedulerPagination.d.ts +7 -0
- package/dist/types/src/client/queue/stall.d.ts +20 -0
- package/dist/types/src/client/queue/types/add.d.ts +40 -0
- package/dist/types/src/client/queue/types/contexts.d.ts +33 -0
- package/dist/types/src/client/queue/types/index.d.ts +3 -0
- package/dist/types/src/client/queue/types/job.d.ts +50 -0
- package/dist/types/src/client/queue/types/runtime.d.ts +35 -0
- package/dist/types/src/client/queue/workers.d.ts +36 -0
- package/dist/types/src/client/queue-events/tcpSubscription.d.ts +23 -0
- package/dist/types/src/client/queue.d.ts +5 -0
- package/dist/types/src/client/queueGroup.d.ts +51 -0
- package/dist/types/src/client/resolveToken.d.ts +10 -0
- package/dist/types/src/client/sandboxed/index.d.ts +7 -0
- package/dist/types/src/client/sandboxed/queueOps.d.ts +24 -0
- package/dist/types/src/client/sandboxed/runtime/dispatch.d.ts +13 -0
- package/dist/types/src/client/sandboxed/runtime/lifecycle.d.ts +20 -0
- package/dist/types/src/client/sandboxed/runtime/log.d.ts +1 -0
- package/dist/types/src/client/sandboxed/runtime/pool.d.ts +11 -0
- package/dist/types/src/client/sandboxed/runtime/recovery.d.ts +11 -0
- package/dist/types/src/client/sandboxed/runtime/state.d.ts +39 -0
- package/dist/types/src/client/sandboxed/types/index.d.ts +2 -0
- package/dist/types/src/client/sandboxed/types/options.d.ts +27 -0
- package/dist/types/src/client/sandboxed/types/process.d.ts +39 -0
- package/dist/types/src/client/sandboxed/worker.d.ts +4 -0
- package/dist/types/src/client/sandboxed/wrapper.d.ts +12 -0
- package/dist/types/src/client/sandboxedWorker.d.ts +6 -0
- package/dist/types/src/client/tcp/client.d.ts +6 -0
- package/dist/types/src/client/tcp/commandQueue.d.ts +23 -0
- package/dist/types/src/client/tcp/connection.d.ts +4 -0
- package/dist/types/src/client/tcp/errors.d.ts +6 -0
- package/dist/types/src/client/tcp/health.d.ts +60 -0
- package/dist/types/src/client/tcp/index.d.ts +11 -0
- package/dist/types/src/client/tcp/reconnect.d.ts +47 -0
- package/dist/types/src/client/tcp/runtime/commands.d.ts +9 -0
- package/dist/types/src/client/tcp/runtime/connectivity.d.ts +13 -0
- package/dist/types/src/client/tcp/runtime/health.d.ts +14 -0
- package/dist/types/src/client/tcp/runtime/lifecycle.d.ts +8 -0
- package/dist/types/src/client/tcp/runtime/state.d.ts +50 -0
- package/dist/types/src/client/tcp/shared.d.ts +12 -0
- package/dist/types/src/client/tcp/transport.d.ts +18 -0
- package/dist/types/src/client/tcp/types/command.d.ts +9 -0
- package/dist/types/src/client/tcp/types/connection.d.ts +31 -0
- package/dist/types/src/client/tcp/types/index.d.ts +5 -0
- package/dist/types/src/client/tcp/types/socket.d.ts +8 -0
- package/dist/types/src/client/tcp/types/tls.d.ts +4 -0
- package/dist/types/src/client/tcp/types.d.ts +2 -0
- package/dist/types/src/client/tcpClient.d.ts +6 -0
- package/dist/types/src/client/tcpPool.d.ts +69 -0
- package/dist/types/src/client/types/connection.d.ts +30 -0
- package/dist/types/src/client/types/dlq.d.ts +45 -0
- package/dist/types/src/client/types/events.d.ts +54 -0
- package/dist/types/src/client/types/flow.d.ts +22 -0
- package/dist/types/src/client/types/index.d.ts +10 -0
- package/dist/types/src/client/types/job.d.ts +131 -0
- package/dist/types/src/client/types/metrics.d.ts +1 -0
- package/dist/types/src/client/types/options.d.ts +72 -0
- package/dist/types/src/client/types/worker.d.ts +54 -0
- package/dist/types/src/client/types.d.ts +2 -0
- package/dist/types/src/client/worker/ackBatcher.d.ts +55 -0
- package/dist/types/src/client/worker/ackFrontier.d.ts +21 -0
- package/dist/types/src/client/worker/ackOutcome.d.ts +8 -0
- package/dist/types/src/client/worker/batchExecution.d.ts +14 -0
- package/dist/types/src/client/worker/constants.d.ts +7 -0
- package/dist/types/src/client/worker/groupConcurrency.d.ts +49 -0
- package/dist/types/src/client/worker/handlers/completion.d.ts +29 -0
- package/dist/types/src/client/worker/handlers/dependencies.d.ts +11 -0
- package/dist/types/src/client/worker/handlers/mutations.d.ts +23 -0
- package/dist/types/src/client/worker/handlers/queries.d.ts +15 -0
- package/dist/types/src/client/worker/jobParser.d.ts +9 -0
- package/dist/types/src/client/worker/processor.d.ts +11 -0
- package/dist/types/src/client/worker/processorHandlers.d.ts +4 -0
- package/dist/types/src/client/worker/processorOutcome.d.ts +14 -0
- package/dist/types/src/client/worker/processorResult.d.ts +2 -0
- package/dist/types/src/client/worker/runtime/buffer.d.ts +8 -0
- package/dist/types/src/client/worker/runtime/control.d.ts +28 -0
- package/dist/types/src/client/worker/runtime/execution.d.ts +16 -0
- package/dist/types/src/client/worker/runtime/lifecycle.d.ts +7 -0
- package/dist/types/src/client/worker/runtime/manual.d.ts +10 -0
- package/dist/types/src/client/worker/runtime/options.d.ts +5 -0
- package/dist/types/src/client/worker/runtime/polling.d.ts +14 -0
- package/dist/types/src/client/worker/runtime/state.d.ts +121 -0
- package/dist/types/src/client/worker/types/index.d.ts +5 -0
- package/dist/types/src/client/worker/types/manual.d.ts +7 -0
- package/dist/types/src/client/worker/types/options.d.ts +26 -0
- package/dist/types/src/client/worker/types/outcome.d.ts +23 -0
- package/dist/types/src/client/worker/types/processor.d.ts +25 -0
- package/dist/types/src/client/worker/types/transport.d.ts +11 -0
- package/dist/types/src/client/worker/worker.d.ts +6 -0
- package/dist/types/src/client/worker/workerHeartbeat.d.ts +15 -0
- package/dist/types/src/client/worker/workerPull.d.ts +24 -0
- package/dist/types/src/client/worker/workerRateLimiter.d.ts +51 -0
- package/dist/types/src/client/worker.d.ts +6 -0
- package/dist/types/src/client/workflow/admission.d.ts +45 -0
- package/dist/types/src/client/workflow/clock.d.ts +60 -0
- package/dist/types/src/client/workflow/compensationChild.d.ts +33 -0
- package/dist/types/src/client/workflow/compensationClaim.d.ts +11 -0
- package/dist/types/src/client/workflow/compensationPass.d.ts +17 -0
- package/dist/types/src/client/workflow/compensationSupport.d.ts +24 -0
- package/dist/types/src/client/workflow/compensator.d.ts +34 -0
- package/dist/types/src/client/workflow/definitionGuard.d.ts +11 -0
- package/dist/types/src/client/workflow/emitter.d.ts +17 -0
- package/dist/types/src/client/workflow/engine.d.ts +66 -0
- package/dist/types/src/client/workflow/eventTypes.d.ts +44 -0
- package/dist/types/src/client/workflow/executionFence.d.ts +15 -0
- package/dist/types/src/client/workflow/executionTypes.d.ts +133 -0
- package/dist/types/src/client/workflow/executor.d.ts +52 -0
- package/dist/types/src/client/workflow/executorLifecycle.d.ts +19 -0
- package/dist/types/src/client/workflow/executorNodes.d.ts +18 -0
- package/dist/types/src/client/workflow/executorQueue.d.ts +9 -0
- package/dist/types/src/client/workflow/forEachRunner.d.ts +4 -0
- package/dist/types/src/client/workflow/identity.d.ts +48 -0
- package/dist/types/src/client/workflow/index.d.ts +23 -0
- package/dist/types/src/client/workflow/loops.d.ts +11 -0
- package/dist/types/src/client/workflow/mapRunner.d.ts +4 -0
- package/dist/types/src/client/workflow/recovery.d.ts +32 -0
- package/dist/types/src/client/workflow/rollbackControl.d.ts +37 -0
- package/dist/types/src/client/workflow/runner.d.ts +23 -0
- package/dist/types/src/client/workflow/runnerTiming.d.ts +14 -0
- package/dist/types/src/client/workflow/stepTypes.d.ts +171 -0
- package/dist/types/src/client/workflow/store.d.ts +83 -0
- package/dist/types/src/client/workflow/storeCodec.d.ts +7 -0
- package/dist/types/src/client/workflow/storeExecutionCodec.d.ts +11 -0
- package/dist/types/src/client/workflow/storeListing.d.ts +11 -0
- package/dist/types/src/client/workflow/storeMaintenance.d.ts +4 -0
- package/dist/types/src/client/workflow/storeSignals.d.ts +70 -0
- package/dist/types/src/client/workflow/subWorkflowRunner.d.ts +14 -0
- package/dist/types/src/client/workflow/types.d.ts +4 -0
- package/dist/types/src/client/workflow/unwindPlan.d.ts +87 -0
- package/dist/types/src/client/workflow/waitFor.d.ts +56 -0
- package/dist/types/src/client/workflow/workflow.d.ts +70 -0
- package/dist/types/src/client/workflow/workflowDecisions.d.ts +11 -0
- package/dist/types/src/client/workflow/workflowDefinition.d.ts +16 -0
- package/dist/types/src/client/workflow/workflowIntrospection.d.ts +5 -0
- package/dist/types/src/client/workflow/workflowValidation.d.ts +44 -0
- package/dist/types/src/config/index.d.ts +9 -0
- package/dist/types/src/config/loader.d.ts +7 -0
- package/dist/types/src/config/resolve.d.ts +59 -0
- package/dist/types/src/config/types.d.ts +88 -0
- package/dist/types/src/domain/job/constants.d.ts +14 -0
- package/dist/types/src/domain/job/create.d.ts +9 -0
- package/dist/types/src/domain/job/groupFifoOrder.d.ts +9 -0
- package/dist/types/src/domain/job/ids.d.ts +7 -0
- package/dist/types/src/domain/job/locks.d.ts +16 -0
- package/dist/types/src/domain/job/payload.d.ts +18 -0
- package/dist/types/src/domain/job/state.d.ts +23 -0
- package/dist/types/src/domain/job/terminal.d.ts +3 -0
- package/dist/types/src/domain/queue/dependencyTracker.d.ts +78 -0
- package/dist/types/src/domain/queue/dlqShard.d.ts +66 -0
- package/dist/types/src/domain/queue/groupLimiterManager.d.ts +30 -0
- package/dist/types/src/domain/queue/groupScheduler.d.ts +31 -0
- package/dist/types/src/domain/queue/groupSchedulerOrder.d.ts +6 -0
- package/dist/types/src/domain/queue/limiterManager.d.ts +68 -0
- package/dist/types/src/domain/queue/priorityQueue.d.ts +54 -0
- package/dist/types/src/domain/queue/priorityQueueOrder.d.ts +3 -0
- package/dist/types/src/domain/queue/shard/dependencies.d.ts +11 -0
- package/dist/types/src/domain/queue/shard/dlq.d.ts +26 -0
- package/dist/types/src/domain/queue/shard/keys.d.ts +19 -0
- package/dist/types/src/domain/queue/shard/lifecycle.d.ts +10 -0
- package/dist/types/src/domain/queue/shard/limits.d.ts +47 -0
- package/dist/types/src/domain/queue/shard/metrics.d.ts +32 -0
- package/dist/types/src/domain/queue/shard/state.d.ts +40 -0
- package/dist/types/src/domain/queue/shard.d.ts +7 -0
- package/dist/types/src/domain/queue/shardCounters.d.ts +35 -0
- package/dist/types/src/domain/queue/temporalIndex.d.ts +24 -0
- package/dist/types/src/domain/queue/temporalManager.d.ts +72 -0
- package/dist/types/src/domain/queue/uniqueKeyManager.d.ts +33 -0
- package/dist/types/src/domain/queue/waiterManager.d.ts +18 -0
- package/dist/types/src/domain/response/builders.d.ts +15 -0
- package/dist/types/src/domain/types/command.d.ts +2 -0
- package/dist/types/src/domain/types/commands/base.d.ts +5 -0
- package/dist/types/src/domain/types/commands/core.d.ts +107 -0
- package/dist/types/src/domain/types/commands/cron.d.ts +36 -0
- package/dist/types/src/domain/types/commands/dashboard.d.ts +13 -0
- package/dist/types/src/domain/types/commands/dlq.d.ts +44 -0
- package/dist/types/src/domain/types/commands/extended.d.ts +63 -0
- package/dist/types/src/domain/types/commands/index.d.ts +12 -0
- package/dist/types/src/domain/types/commands/limits.d.ts +108 -0
- package/dist/types/src/domain/types/commands/management.d.ts +73 -0
- package/dist/types/src/domain/types/commands/monitoring.d.ts +49 -0
- package/dist/types/src/domain/types/commands/protocol.d.ts +20 -0
- package/dist/types/src/domain/types/commands/query.d.ts +46 -0
- package/dist/types/src/domain/types/commands/union.d.ts +13 -0
- package/dist/types/src/domain/types/commands/workers.d.ts +39 -0
- package/dist/types/src/domain/types/cron.d.ts +89 -0
- package/dist/types/src/domain/types/deduplication.d.ts +43 -0
- package/dist/types/src/domain/types/dlq.d.ts +136 -0
- package/dist/types/src/domain/types/flow.d.ts +25 -0
- package/dist/types/src/domain/types/group.d.ts +26 -0
- package/dist/types/src/domain/types/job.d.ts +8 -0
- package/dist/types/src/domain/types/jobs/model.d.ts +150 -0
- package/dist/types/src/domain/types/metrics.d.ts +16 -0
- package/dist/types/src/domain/types/priorityQueue.d.ts +13 -0
- package/dist/types/src/domain/types/protocol.d.ts +5 -0
- package/dist/types/src/domain/types/queue.d.ts +110 -0
- package/dist/types/src/domain/types/response.d.ts +3 -0
- package/dist/types/src/domain/types/responses/model.d.ts +152 -0
- package/dist/types/src/domain/types/shard.d.ts +4 -0
- package/dist/types/src/domain/types/stall.d.ts +48 -0
- package/dist/types/src/domain/types/webhook.d.ts +42 -0
- package/dist/types/src/domain/types/worker.d.ts +40 -0
- package/dist/types/src/infrastructure/backup/backupTelemetry.d.ts +30 -0
- package/dist/types/src/infrastructure/backup/s3BackupConfig.d.ts +80 -0
- package/dist/types/src/infrastructure/cloud/types/config.d.ts +18 -0
- package/dist/types/src/infrastructure/cloud/types/event.d.ts +14 -0
- package/dist/types/src/infrastructure/cloud/types/snapshot.d.ts +52 -0
- package/dist/types/src/infrastructure/cloud/types/snapshotCore.d.ts +125 -0
- package/dist/types/src/infrastructure/cloud/types/snapshotJobs.d.ts +124 -0
- package/dist/types/src/infrastructure/cloud/types/snapshotTelemetry.d.ts +100 -0
- package/dist/types/src/infrastructure/cloud/types.d.ts +3 -0
- package/dist/types/src/infrastructure/persistence/batchInsert.d.ts +13 -0
- package/dist/types/src/infrastructure/persistence/completedJobCountSchema.d.ts +6 -0
- package/dist/types/src/infrastructure/persistence/dependencyCompletionSchema.d.ts +6 -0
- package/dist/types/src/infrastructure/persistence/dependencyCompletionStore.d.ts +40 -0
- package/dist/types/src/infrastructure/persistence/index.d.ts +5 -0
- package/dist/types/src/infrastructure/persistence/jobOptionsBlob.d.ts +19 -0
- package/dist/types/src/infrastructure/persistence/legacyNameMigration.d.ts +17 -0
- package/dist/types/src/infrastructure/persistence/migrationProgressSchema.d.ts +2 -0
- package/dist/types/src/infrastructure/persistence/migrations.d.ts +3 -0
- package/dist/types/src/infrastructure/persistence/schema.d.ts +8 -0
- package/dist/types/src/infrastructure/persistence/sqlite/admission.d.ts +9 -0
- package/dist/types/src/infrastructure/persistence/sqlite/completed.d.ts +17 -0
- package/dist/types/src/infrastructure/persistence/sqlite/control.d.ts +48 -0
- package/dist/types/src/infrastructure/persistence/sqlite/flows.d.ts +26 -0
- package/dist/types/src/infrastructure/persistence/sqlite/jobLifecycle.d.ts +17 -0
- package/dist/types/src/infrastructure/persistence/sqlite/jobs.d.ts +15 -0
- package/dist/types/src/infrastructure/persistence/sqlite/lifecycle.d.ts +6 -0
- package/dist/types/src/infrastructure/persistence/sqlite/mutations.d.ts +27 -0
- package/dist/types/src/infrastructure/persistence/sqlite/queries.d.ts +23 -0
- package/dist/types/src/infrastructure/persistence/sqlite/queueDeletionSql.d.ts +3 -0
- package/dist/types/src/infrastructure/persistence/sqlite/records.d.ts +24 -0
- package/dist/types/src/infrastructure/persistence/sqlite/state.d.ts +42 -0
- package/dist/types/src/infrastructure/persistence/sqlite/telemetry.d.ts +17 -0
- package/dist/types/src/infrastructure/persistence/sqlite/telemetryStore.d.ts +30 -0
- package/dist/types/src/infrastructure/persistence/sqlite/telemetryWrites.d.ts +47 -0
- package/dist/types/src/infrastructure/persistence/sqlite.d.ts +6 -0
- package/dist/types/src/infrastructure/persistence/sqliteBatch.d.ts +4 -0
- package/dist/types/src/infrastructure/persistence/sqliteMigration.d.ts +5 -0
- package/dist/types/src/infrastructure/persistence/sqliteSerializer.d.ts +50 -0
- package/dist/types/src/infrastructure/persistence/statements.d.ts +86 -0
- package/dist/types/src/infrastructure/persistence/types/admission.d.ts +8 -0
- package/dist/types/src/infrastructure/persistence/types/batch.d.ts +12 -0
- package/dist/types/src/infrastructure/persistence/types/sqlite.d.ts +27 -0
- package/dist/types/src/infrastructure/persistence/writeBuffer.d.ts +48 -0
- package/dist/types/src/infrastructure/persistence/writeBufferPending.d.ts +11 -0
- package/dist/types/src/infrastructure/scheduler/cron/execution.d.ts +12 -0
- package/dist/types/src/infrastructure/scheduler/cron/persisted.d.ts +5 -0
- package/dist/types/src/infrastructure/scheduler/cron/runtime.d.ts +31 -0
- package/dist/types/src/infrastructure/scheduler/cron/validation.d.ts +3 -0
- package/dist/types/src/infrastructure/scheduler/cronParser.d.ts +45 -0
- package/dist/types/src/infrastructure/scheduler/cronScheduler.d.ts +5 -0
- package/dist/types/src/infrastructure/scheduler/types/cronScheduler.d.ts +16 -0
- package/dist/types/src/infrastructure/server/protocol/commands.d.ts +8 -0
- package/dist/types/src/infrastructure/server/protocol/frameParser.d.ts +16 -0
- package/dist/types/src/infrastructure/server/protocol/lineBuffer.d.ts +6 -0
- package/dist/types/src/infrastructure/server/protocol/validation.d.ts +10 -0
- package/dist/types/src/infrastructure/server/protocol.d.ts +6 -0
- package/dist/types/src/infrastructure/server/socketWriteQueue.d.ts +66 -0
- package/dist/types/src/infrastructure/server/types/protocol.d.ts +4 -0
- package/dist/types/src/require-bun.d.ts +13 -0
- package/dist/types/src/shared/asyncLock.d.ts +13 -0
- package/dist/types/src/shared/boundedMap.d.ts +30 -0
- package/dist/types/src/shared/boundedSet.d.ts +26 -0
- package/dist/types/src/shared/hash.d.ts +30 -0
- package/dist/types/src/shared/histogram.d.ts +23 -0
- package/dist/types/src/shared/lock.d.ts +13 -0
- package/dist/types/src/shared/lockError.d.ts +3 -0
- package/dist/types/src/shared/lockTimeout.d.ts +2 -0
- package/dist/types/src/shared/logger.d.ts +48 -0
- package/dist/types/src/shared/lru.d.ts +9 -0
- package/dist/types/src/shared/lruMap.d.ts +42 -0
- package/dist/types/src/shared/lruSet.d.ts +36 -0
- package/dist/types/src/shared/minHeap.d.ts +43 -0
- package/dist/types/src/shared/msgpack.d.ts +3 -0
- package/dist/types/src/shared/pausedView.d.ts +19 -0
- package/dist/types/src/shared/rwLock.d.ts +22 -0
- package/dist/types/src/shared/serialization.d.ts +24 -0
- package/dist/types/src/shared/skipList.d.ts +97 -0
- package/dist/types/src/shared/skipListNodes.d.ts +6 -0
- package/dist/types/src/shared/storageHealth.d.ts +9 -0
- package/dist/types/src/shared/ttlMap.d.ts +81 -0
- package/dist/types/src/shared/types/lock.d.ts +7 -0
- package/dist/types/src/shared/types/skipList.d.ts +4 -0
- package/dist/types/src/shared/version.d.ts +4 -0
- package/dist/types/src/shared/webhookValidation.d.ts +6 -0
- package/package.json +27 -9
- package/src/ack-batcher.ts +8 -5
- package/src/bunqueue/bunqueue-api.ts +1 -1
- package/src/bunqueue/bunqueue.ts +2 -1
- package/src/canonical-transport/bun-sqlite-types.ts +22 -0
- package/src/canonical-transport/dlq.ts +12 -0
- package/src/canonical-transport/embedded.ts +55 -0
- package/src/canonical-transport/runtime.ts +49 -0
- package/src/canonical-transport/thread-worker.ts +83 -0
- package/src/canonical-transport/transport.ts +153 -0
- package/src/connection.ts +25 -30
- package/src/errors.ts +3 -0
- package/src/flow-commit.ts +45 -0
- package/src/flow-plan-legacy.ts +117 -0
- package/src/flow-plan.ts +209 -0
- package/src/flow-types.ts +4 -0
- package/src/flow.ts +31 -163
- package/src/frame.ts +5 -2
- package/src/index.ts +7 -75
- package/src/job.ts +43 -9
- package/src/legacy.ts +91 -0
- package/src/observability.ts +59 -1
- package/src/queue-admin.ts +5 -5
- package/src/queue-control.ts +8 -6
- package/src/queue.ts +10 -6
- package/src/serialization.ts +93 -0
- package/src/terminal-outcome.ts +58 -0
- package/src/types.ts +3 -6
- package/src/worker-base.ts +9 -6
- package/src/worker-slot-signal.ts +23 -0
- package/src/worker.ts +11 -5
- package/dist/backpressure.js +0 -39
- package/dist/bunqueue/aging.js +0 -53
- package/dist/bunqueue/batch.js +0 -60
- package/dist/bunqueue/bunqueue-api.js +0 -116
- package/dist/bunqueue/bunqueue.js +0 -194
- package/dist/bunqueue/cancellation.js +0 -48
- package/dist/bunqueue/circuit-breaker.js +0 -69
- package/dist/bunqueue/dedup-debounce.js +0 -37
- package/dist/bunqueue/dlq-rate-limit.js +0 -65
- package/dist/bunqueue/rate-gate.js +0 -61
- package/dist/bunqueue/retry.js +0 -56
- package/dist/bunqueue/triggers.js +0 -42
- package/dist/bunqueue/ttl.js +0 -31
- package/dist/bunqueue/types.js +0 -6
- package/dist/connection-pool.js +0 -60
- package/dist/connection-types.js +0 -2
- package/dist/connection.js +0 -281
- package/dist/errors.js +0 -25
- package/dist/flow-types.js +0 -2
- package/dist/flow.js +0 -212
- package/dist/job.js +0 -155
- package/dist/observability.js +0 -110
- package/dist/queue-admin.js +0 -158
- package/dist/queue-control.js +0 -107
- package/dist/queue-query.js +0 -187
- package/dist/queue.js +0 -92
- package/dist/responses.js +0 -10
- package/dist/socket-factory.js +0 -47
- package/dist/types.js +0 -50
- package/dist/worker-base.js +0 -159
- package/dist/worker-types.js +0 -5
- package/dist/worker.js +0 -211
- /package/dist/{backpressure.d.ts → types/sdk/typescript/src/backpressure.d.ts} +0 -0
- /package/dist/{bunqueue → types/sdk/typescript/src/bunqueue}/cancellation.d.ts +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared FAIL payload builder.
|
|
3
|
+
*
|
|
4
|
+
* Several client entry points move a job to `failed` (the Queue reflection API
|
|
5
|
+
* `queue.getJob(id).moveToFailed()`, the job proxies, and `moveJobToFailed`).
|
|
6
|
+
* They must all persist the stacktrace (#74) and honour `UnrecoverableError`,
|
|
7
|
+
* exactly like the worker failure path — otherwise the stack and the
|
|
8
|
+
* "do not retry" intent are silently dropped (the #111 silent-loss class).
|
|
9
|
+
* Centralising the mapping here keeps every site consistent.
|
|
10
|
+
*/
|
|
11
|
+
/** Build the TCP `FAIL` command for an explicit job failure. */
|
|
12
|
+
export declare function buildFailCommand(id: string, error: Error, token?: string): Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Decompose an error into the trailing args of the embedded
|
|
15
|
+
* `manager.fail(jobId, error?, token?, unrecoverable?, stack?)` signature.
|
|
16
|
+
*/
|
|
17
|
+
export declare function failEmbeddedArgs(error: Error, token?: string): [string, string | undefined, boolean, string[] | undefined];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Queue Helpers
|
|
3
|
+
* Utility functions for queue operations
|
|
4
|
+
*/
|
|
5
|
+
import type { getSharedManager } from "../manager.js";
|
|
6
|
+
import type { Shard } from "../../domain/queue/shard.js";
|
|
7
|
+
import type { DlqFilter, DlqConfig as DomainDlqConfig } from "../../domain/types/dlq.js";
|
|
8
|
+
import type { DlqFilter as ClientDlqFilter } from "../types.js";
|
|
9
|
+
import type * as dlqOps from "../../application/dlqManager.js";
|
|
10
|
+
/** Check if embedded mode should be forced (for tests) */
|
|
11
|
+
export declare const FORCE_EMBEDDED: boolean;
|
|
12
|
+
/** Get shard from manager (embedded mode only) */
|
|
13
|
+
export declare function getShard(manager: ReturnType<typeof getSharedManager>, queue: string): Shard;
|
|
14
|
+
/** Create DLQ context (embedded mode only) */
|
|
15
|
+
export declare function getDlqContext(manager: ReturnType<typeof getSharedManager>): dlqOps.DlqContext;
|
|
16
|
+
/** Convert client filter to domain filter */
|
|
17
|
+
export declare function toDomainFilter(filter: ClientDlqFilter | undefined): DlqFilter | undefined;
|
|
18
|
+
/** Convert client DLQ config to domain config */
|
|
19
|
+
export declare function toDomainDlqConfig(config: Record<string, unknown>): Partial<DomainDlqConfig>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TcpConnectionPool } from "../../tcpPool.js";
|
|
2
|
+
export declare function computeDependencies(id: string, queueName: string, tcp: TcpConnectionPool): Promise<{
|
|
3
|
+
processed: Record<string, unknown>;
|
|
4
|
+
unprocessed: string[];
|
|
5
|
+
}>;
|
|
6
|
+
export declare function computeSimpleDependencies(id: string, queueName: string, embedded: boolean | undefined, tcp: TcpConnectionPool | null | undefined): Promise<{
|
|
7
|
+
processed: Record<string, unknown>;
|
|
8
|
+
unprocessed: string[];
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Job } from "../../types.js";
|
|
2
|
+
import type { JobProxyContext, JobReflectionMeta } from "../types/job.js";
|
|
3
|
+
/** Create a full Job proxy whose methods use the TCP transport. */
|
|
4
|
+
export declare function createJobProxy<T>(id: string, name: string, data: T, ctx: JobProxyContext, meta?: JobReflectionMeta): Job<T>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Job as InternalJob } from "../../domain/types/job.js";
|
|
2
|
+
import type { JobReflectionMeta } from "./types/job.js";
|
|
3
|
+
export interface TerminalJobView extends InternalJob {
|
|
4
|
+
returnvalue?: unknown;
|
|
5
|
+
failedReason?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Build one public metadata shape for embedded and TCP queue reads. */
|
|
8
|
+
export declare function metadataFromJob(job: TerminalJobView, embeddedResult?: unknown): JobReflectionMeta;
|
|
9
|
+
/** Encode terminal values for BullMQ-compatible raw JSON output. */
|
|
10
|
+
export declare function serializeReturnvalue(value: unknown): string | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Job Move Operations (BullMQ v5 compatible)
|
|
3
|
+
*/
|
|
4
|
+
import type { TcpConnectionPool } from "../tcpPool.js";
|
|
5
|
+
interface JobMoveContext {
|
|
6
|
+
name: string;
|
|
7
|
+
embedded: boolean;
|
|
8
|
+
tcp: TcpConnectionPool | null;
|
|
9
|
+
getJobState: (id: string) => Promise<'waiting' | 'prioritized' | 'delayed' | 'active' | 'completed' | 'failed' | 'waiting-children' | 'unknown'>;
|
|
10
|
+
getJobDependencies: (id: string) => Promise<{
|
|
11
|
+
processed: Record<string, unknown>;
|
|
12
|
+
unprocessed: string[];
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
/** Move job to completed state */
|
|
16
|
+
export declare function moveJobToCompleted(ctx: JobMoveContext, id: string, returnValue: unknown, token?: string): Promise<unknown>;
|
|
17
|
+
/** Move job to failed state */
|
|
18
|
+
export declare function moveJobToFailed(ctx: JobMoveContext, id: string, error: Error, token?: string): Promise<void>;
|
|
19
|
+
/** Move job back to waiting state */
|
|
20
|
+
export declare function moveJobToWait(ctx: JobMoveContext, id: string, token?: string): Promise<boolean>;
|
|
21
|
+
/** Move job to delayed state */
|
|
22
|
+
export declare function moveJobToDelayed(ctx: JobMoveContext, id: string, timestamp: number, token?: string): Promise<void>;
|
|
23
|
+
/** Move job to waiting-children state */
|
|
24
|
+
export declare function moveJobToWaitingChildren(ctx: JobMoveContext, id: string, token?: string, _opts?: {
|
|
25
|
+
child?: {
|
|
26
|
+
id: string;
|
|
27
|
+
queue: string;
|
|
28
|
+
};
|
|
29
|
+
}): Promise<boolean>;
|
|
30
|
+
/** Wait until job has finished */
|
|
31
|
+
export declare function waitJobUntilFinished(ctx: JobMoveContext, id: string, queueEvents: unknown, ttl?: number): Promise<unknown>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JobOptions } from "../../../types.js";
|
|
2
|
+
import type { ExtendedJobOptions } from "../../types/add.js";
|
|
3
|
+
export declare function compact<T extends Record<string, unknown>>(object: T): T;
|
|
4
|
+
export declare function parseDate(date: Date | string | number | undefined): number | undefined;
|
|
5
|
+
export declare function buildRepeatOptions(repeat: NonNullable<JobOptions['repeat']>): {
|
|
6
|
+
every: number | undefined;
|
|
7
|
+
limit: number | undefined;
|
|
8
|
+
pattern: string | undefined;
|
|
9
|
+
count: number | undefined;
|
|
10
|
+
startDate: number | undefined;
|
|
11
|
+
endDate: number | undefined;
|
|
12
|
+
tz: string | undefined;
|
|
13
|
+
immediately: boolean | undefined;
|
|
14
|
+
prevMillis: number | undefined;
|
|
15
|
+
offset: number | undefined;
|
|
16
|
+
jobId: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
export declare function buildPushPayload(queue: string, name: string, data: unknown, options: ExtendedJobOptions): Record<string, unknown>;
|
|
19
|
+
export declare function resolveGroupId(options: ExtendedJobOptions): string | undefined;
|
|
20
|
+
export declare function buildJobData(data: unknown, options: ExtendedJobOptions): unknown;
|
|
21
|
+
export declare function reflectionMeta(options: ExtendedJobOptions): {
|
|
22
|
+
priority?: number;
|
|
23
|
+
delay?: number;
|
|
24
|
+
opts: JobOptions;
|
|
25
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Queue Control Operations
|
|
3
|
+
* pause, resume, drain, obliterate, isPaused
|
|
4
|
+
*/
|
|
5
|
+
import type { TcpConnectionPool } from "../../tcpPool.js";
|
|
6
|
+
interface ControlContext {
|
|
7
|
+
name: string;
|
|
8
|
+
embedded: boolean;
|
|
9
|
+
tcp: TcpConnectionPool | null;
|
|
10
|
+
}
|
|
11
|
+
/** Pause the queue */
|
|
12
|
+
export declare function pause(ctx: ControlContext): void;
|
|
13
|
+
/** Pause the queue and resolve once the server has processed it. */
|
|
14
|
+
export declare function pauseAsync(ctx: ControlContext): Promise<void>;
|
|
15
|
+
/** Resume the queue */
|
|
16
|
+
export declare function resume(ctx: ControlContext): void;
|
|
17
|
+
/** Resume the queue and resolve once the server has processed it. */
|
|
18
|
+
export declare function resumeAsync(ctx: ControlContext): Promise<void>;
|
|
19
|
+
/** Drain the queue (remove all waiting jobs) */
|
|
20
|
+
export declare function drain(ctx: ControlContext): void;
|
|
21
|
+
/**
|
|
22
|
+
* Drain the queue and resolve with the number of removed jobs once the
|
|
23
|
+
* server has processed it. Same ordering guarantee as obliterateAsync():
|
|
24
|
+
* jobs added after resolution cannot be caught by a late-arriving drain.
|
|
25
|
+
*/
|
|
26
|
+
export declare function drainAsync(ctx: ControlContext): Promise<number>;
|
|
27
|
+
/** Obliterate the queue (remove all jobs and data) */
|
|
28
|
+
export declare function obliterate(ctx: ControlContext): void;
|
|
29
|
+
/**
|
|
30
|
+
* Obliterate the queue and resolve once the server has processed it.
|
|
31
|
+
* The fire-and-forget obliterate() gives no ordering guarantee over a
|
|
32
|
+
* multi-connection pool: a PUSH sent right after it can be processed first
|
|
33
|
+
* and then wiped. Await this variant before enqueuing follow-up jobs.
|
|
34
|
+
*/
|
|
35
|
+
export declare function obliterateAsync(ctx: ControlContext): Promise<void>;
|
|
36
|
+
/** Check if queue is paused (sync, embedded only) */
|
|
37
|
+
export declare function isPaused(ctx: ControlContext): boolean;
|
|
38
|
+
/** Check if queue is paused (async, works with TCP) */
|
|
39
|
+
export declare function isPausedAsync(ctx: ControlContext): Promise<boolean>;
|
|
40
|
+
/** Wait until queue is ready */
|
|
41
|
+
export declare function waitUntilReady(ctx: ControlContext): Promise<void>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Queue Count Operations
|
|
3
|
+
* getJobCounts, getWaitingCount, getDelayedCount, etc.
|
|
4
|
+
*/
|
|
5
|
+
import type { TcpConnectionPool } from "../../tcpPool.js";
|
|
6
|
+
interface CountsContext {
|
|
7
|
+
name: string;
|
|
8
|
+
embedded: boolean;
|
|
9
|
+
tcp: TcpConnectionPool | null;
|
|
10
|
+
}
|
|
11
|
+
export interface JobCounts {
|
|
12
|
+
waiting: number;
|
|
13
|
+
prioritized: number;
|
|
14
|
+
active: number;
|
|
15
|
+
completed: number;
|
|
16
|
+
failed: number;
|
|
17
|
+
delayed: number;
|
|
18
|
+
paused: number;
|
|
19
|
+
'waiting-children': number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get job counts.
|
|
23
|
+
* Embedded mode returns synchronously. TCP mode delegates to the async path so
|
|
24
|
+
* callers receive the REAL server-side counts (awaitable Promise) instead of
|
|
25
|
+
* hardcoded zeros — defect: getjobcounts-tcp-zero.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getJobCounts(ctx: CountsContext): JobCounts | Promise<JobCounts>;
|
|
28
|
+
/** Get job counts (async, works with TCP) */
|
|
29
|
+
export declare function getJobCountsAsync(ctx: CountsContext): Promise<JobCounts>;
|
|
30
|
+
/** Get waiting job count */
|
|
31
|
+
export declare function getWaitingCount(ctx: CountsContext): Promise<number>;
|
|
32
|
+
/** Get active job count */
|
|
33
|
+
export declare function getActiveCount(ctx: CountsContext): Promise<number>;
|
|
34
|
+
/** Get completed job count */
|
|
35
|
+
export declare function getCompletedCount(ctx: CountsContext): Promise<number>;
|
|
36
|
+
/** Get failed job count */
|
|
37
|
+
export declare function getFailedCount(ctx: CountsContext): Promise<number>;
|
|
38
|
+
/** Get delayed job count */
|
|
39
|
+
export declare function getDelayedCount(ctx: CountsContext): Promise<number>;
|
|
40
|
+
/** Get total job count for the queue */
|
|
41
|
+
export declare function count(ctx: CountsContext): number;
|
|
42
|
+
/** Get total job count (async, works with TCP) */
|
|
43
|
+
export declare function countAsync(ctx: CountsContext): Promise<number>;
|
|
44
|
+
/** Get counts grouped by priority */
|
|
45
|
+
export declare function getCountsPerPriority(ctx: CountsContext): Record<number, number>;
|
|
46
|
+
/** Get counts grouped by priority (async) */
|
|
47
|
+
export declare function getCountsPerPriorityAsync(ctx: CountsContext): Promise<Record<number, number>>;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TcpConnectionPool } from "../../tcpPool.js";
|
|
2
|
+
interface GroupContext {
|
|
3
|
+
name: string;
|
|
4
|
+
embedded: boolean;
|
|
5
|
+
tcp: TcpConnectionPool | null;
|
|
6
|
+
dataPath: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function getGroupJobsCount(ctx: GroupContext, groupId: string): Promise<number>;
|
|
9
|
+
export declare function getGroupsJobsCount(ctx: GroupContext, maxCount?: number): Promise<number>;
|
|
10
|
+
export declare function getGroupActiveCount(ctx: GroupContext, groupId: string): Promise<number>;
|
|
11
|
+
export declare function setGroupRateLimit(ctx: GroupContext, groupId: string, max: number, duration: number): Promise<void>;
|
|
12
|
+
export declare function getGroupRateLimit(ctx: GroupContext, groupId: string): Promise<{
|
|
13
|
+
max: number;
|
|
14
|
+
duration: number;
|
|
15
|
+
} | null>;
|
|
16
|
+
export declare function removeGroupRateLimit(ctx: GroupContext, groupId: string): Promise<number>;
|
|
17
|
+
export declare function getGroupRateLimitTtl(ctx: GroupContext, groupId: string, maxJobs?: number): Promise<number>;
|
|
18
|
+
export declare function setGroupConcurrency(ctx: GroupContext, groupId: string, concurrency: number): Promise<void>;
|
|
19
|
+
export declare function getGroupConcurrency(ctx: GroupContext, groupId: string): Promise<number | null>;
|
|
20
|
+
export declare function removeGroupConcurrency(ctx: GroupContext, groupId: string): Promise<number>;
|
|
21
|
+
export declare function pauseGroup(ctx: GroupContext, groupId: string): Promise<boolean>;
|
|
22
|
+
export declare function resumeGroup(ctx: GroupContext, groupId: string): Promise<boolean>;
|
|
23
|
+
export declare function isGroupPaused(ctx: GroupContext, groupId: string): Promise<boolean>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { TcpConnectionPool } from "../../tcpPool.js";
|
|
2
|
+
interface ManagementContext {
|
|
3
|
+
name: string;
|
|
4
|
+
embedded: boolean;
|
|
5
|
+
tcp: TcpConnectionPool | null;
|
|
6
|
+
}
|
|
7
|
+
/** Remove a job (sync, fire-and-forget; use removeAsync to await the removal) */
|
|
8
|
+
export declare function remove(ctx: ManagementContext, id: string): void;
|
|
9
|
+
/** Remove a job (async) */
|
|
10
|
+
export declare function removeAsync(ctx: ManagementContext, id: string): Promise<void>;
|
|
11
|
+
/** Retry a specific job — BullMQ contract: failed → waiting. */
|
|
12
|
+
export declare function retryJob(ctx: ManagementContext, id: string): Promise<void>;
|
|
13
|
+
/** Retry jobs matching criteria */
|
|
14
|
+
export declare function retryJobs(ctx: ManagementContext, opts?: {
|
|
15
|
+
state?: 'failed' | 'completed';
|
|
16
|
+
count?: number;
|
|
17
|
+
timestamp?: number;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
/** Clean old jobs (sync) */
|
|
20
|
+
export declare function clean(ctx: ManagementContext, grace: number, limit: number, type?: 'completed' | 'wait' | 'active' | 'paused' | 'delayed' | 'failed'): string[];
|
|
21
|
+
/** Clean old jobs (async) */
|
|
22
|
+
export declare function cleanAsync(ctx: ManagementContext, grace: number, limit: number, type?: 'completed' | 'wait' | 'active' | 'paused' | 'delayed' | 'failed'): Promise<string[]>;
|
|
23
|
+
/** Promote delayed jobs to waiting */
|
|
24
|
+
export declare function promoteJobs(ctx: ManagementContext, opts?: {
|
|
25
|
+
count?: number;
|
|
26
|
+
}): Promise<number>;
|
|
27
|
+
/** Promote a single job */
|
|
28
|
+
export declare function promoteJob(ctx: ManagementContext, id: string): Promise<void>;
|
|
29
|
+
/** Update job progress */
|
|
30
|
+
export declare function updateJobProgress(ctx: ManagementContext, id: string, progress: number | object): Promise<void>;
|
|
31
|
+
/** Get job logs */
|
|
32
|
+
export declare function getJobLogs(ctx: ManagementContext, id: string, start?: number, end?: number): Promise<{
|
|
33
|
+
logs: string[];
|
|
34
|
+
count: number;
|
|
35
|
+
}>;
|
|
36
|
+
/** Add a log entry to a job */
|
|
37
|
+
export declare function addJobLog(ctx: ManagementContext, id: string, logRow: string): Promise<number>;
|
|
38
|
+
/** Clear job logs */
|
|
39
|
+
export declare function clearJobLogs(ctx: ManagementContext, id: string, keepLogs?: number): Promise<void>;
|
|
40
|
+
/** Update job data */
|
|
41
|
+
export declare function updateJobData(ctx: ManagementContext, id: string, data: unknown): Promise<void>;
|
|
42
|
+
/** Change job delay */
|
|
43
|
+
export declare function changeJobDelay(ctx: ManagementContext, id: string, delay: number): Promise<void>;
|
|
44
|
+
/** Change job priority */
|
|
45
|
+
export declare function changeJobPriority(ctx: ManagementContext, id: string, opts: {
|
|
46
|
+
priority: number;
|
|
47
|
+
lifo?: boolean;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
/** Extend job lock */
|
|
50
|
+
export declare function extendJobLock(ctx: ManagementContext, id: string, token: string, duration: number): Promise<number>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { TcpConnectionPool } from "../../tcpPool.js";
|
|
2
|
+
import type { Job, JobStateType, GetDependenciesOpts, JobDependencies, JobDependenciesCount } from "../../types.js";
|
|
3
|
+
export interface QueryContext {
|
|
4
|
+
name: string;
|
|
5
|
+
embedded: boolean;
|
|
6
|
+
tcp: TcpConnectionPool | null;
|
|
7
|
+
getJobState: (id: string) => Promise<JobStateType>;
|
|
8
|
+
removeAsync: (id: string) => Promise<void>;
|
|
9
|
+
retryJob: (id: string) => Promise<void>;
|
|
10
|
+
getChildrenValues: (id: string) => Promise<Record<string, unknown>>;
|
|
11
|
+
updateJobData?: (id: string, data: unknown) => Promise<void>;
|
|
12
|
+
promoteJob?: (id: string) => Promise<void>;
|
|
13
|
+
changeJobDelay?: (id: string, delay: number) => Promise<void>;
|
|
14
|
+
changeJobPriority?: (id: string, opts: {
|
|
15
|
+
priority: number;
|
|
16
|
+
lifo?: boolean;
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
extendJobLock?: (id: string, token: string, duration: number) => Promise<number>;
|
|
19
|
+
clearJobLogs?: (id: string, keepLogs?: number) => Promise<void>;
|
|
20
|
+
getJobDependencies?: (id: string, opts?: GetDependenciesOpts) => Promise<JobDependencies>;
|
|
21
|
+
getJobDependenciesCount?: (id: string, opts?: GetDependenciesOpts) => Promise<JobDependenciesCount>;
|
|
22
|
+
moveJobToCompleted?: (id: string, returnValue: unknown, token?: string) => Promise<unknown>;
|
|
23
|
+
moveJobToFailed?: (id: string, error: Error, token?: string) => Promise<void>;
|
|
24
|
+
moveJobToWait?: (id: string, token?: string) => Promise<boolean>;
|
|
25
|
+
moveJobToDelayed?: (id: string, timestamp: number, token?: string) => Promise<void>;
|
|
26
|
+
moveJobToWaitingChildren?: (id: string, token?: string, opts?: {
|
|
27
|
+
child?: {
|
|
28
|
+
id: string;
|
|
29
|
+
queue: string;
|
|
30
|
+
};
|
|
31
|
+
}) => Promise<boolean>;
|
|
32
|
+
waitJobUntilFinished?: (id: string, queueEvents: unknown, ttl?: number) => Promise<unknown>;
|
|
33
|
+
}
|
|
34
|
+
/** Get a single job by ID */
|
|
35
|
+
export declare function getJob<T>(ctx: QueryContext, id: string): Promise<Job<T> | null>;
|
|
36
|
+
/** Get job state by ID */
|
|
37
|
+
export declare function getJobState(ctx: QueryContext, id: string): Promise<JobStateType>;
|
|
38
|
+
/** Get children values for a job */
|
|
39
|
+
export declare function getChildrenValues(ctx: QueryContext, id: string): Promise<Record<string, unknown>>;
|
|
40
|
+
interface GetJobsOptions {
|
|
41
|
+
state?: string | string[];
|
|
42
|
+
start?: number;
|
|
43
|
+
end?: number;
|
|
44
|
+
asc?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/** Get jobs with filtering (sync, embedded only) */
|
|
47
|
+
export declare function getJobs<T>(ctx: QueryContext, options?: GetJobsOptions): Job<T>[];
|
|
48
|
+
/** Get jobs with filtering (async, works with TCP) */
|
|
49
|
+
export declare function getJobsAsync<T>(ctx: QueryContext, options?: GetJobsOptions): Promise<Job<T>[]>;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** State-specific aliases over the generic queue query operations. */
|
|
2
|
+
import type { Job } from "../../types.js";
|
|
3
|
+
import { type QueryContext } from "./query.js";
|
|
4
|
+
export declare function getWaiting<T>(ctx: QueryContext, start?: number, end?: number): Job<T>[];
|
|
5
|
+
export declare function getWaitingAsync<T>(ctx: QueryContext, start?: number, end?: number): Promise<Job<T>[]>;
|
|
6
|
+
export declare function getDelayed<T>(ctx: QueryContext, start?: number, end?: number): Job<T>[];
|
|
7
|
+
export declare function getDelayedAsync<T>(ctx: QueryContext, start?: number, end?: number): Promise<Job<T>[]>;
|
|
8
|
+
export declare function getActive<T>(ctx: QueryContext, start?: number, end?: number): Job<T>[];
|
|
9
|
+
export declare function getActiveAsync<T>(ctx: QueryContext, start?: number, end?: number): Promise<Job<T>[]>;
|
|
10
|
+
export declare function getCompleted<T>(ctx: QueryContext, start?: number, end?: number): Job<T>[];
|
|
11
|
+
export declare function getCompletedAsync<T>(ctx: QueryContext, start?: number, end?: number): Promise<Job<T>[]>;
|
|
12
|
+
export declare function getFailed<T>(ctx: QueryContext, start?: number, end?: number): Job<T>[];
|
|
13
|
+
export declare function getFailedAsync<T>(ctx: QueryContext, start?: number, end?: number): Promise<Job<T>[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TcpConnectionPool } from "../../tcpPool.js";
|
|
2
|
+
interface TcpQueryContext {
|
|
3
|
+
name: string;
|
|
4
|
+
tcp: TcpConnectionPool;
|
|
5
|
+
}
|
|
6
|
+
export interface TcpJobQueryOptions {
|
|
7
|
+
state?: string | string[];
|
|
8
|
+
start?: number;
|
|
9
|
+
end?: number;
|
|
10
|
+
asc?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Read a finite range once, or page until exhaustion when `end` is -1. */
|
|
13
|
+
export declare function fetchTcpJobRows(ctx: TcpQueryContext, options: TcpJobQueryOptions): Promise<Record<string, unknown>[] | null>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** BullMQ-style queue for job management. */
|
|
2
|
+
import { Forwarder, type ForwardOptions } from "../forwarder.js";
|
|
3
|
+
import { QueueConnection } from "./runtime/connection.js";
|
|
4
|
+
/** Public Queue façade; behavior is implemented by focused runtime layers. */
|
|
5
|
+
export declare class Queue<T = unknown> extends QueueConnection<T> {
|
|
6
|
+
/**
|
|
7
|
+
* Drain this queue's jobs to a remote bunqueue server (store-and-forward).
|
|
8
|
+
* Remote failures leave jobs local and deterministic remote IDs prevent
|
|
9
|
+
* duplicate delivery when a forward is retried.
|
|
10
|
+
*/
|
|
11
|
+
forward(options: ForwardOptions): Forwarder;
|
|
12
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rate Limit and Concurrency Operations
|
|
3
|
+
*/
|
|
4
|
+
import type { TcpConnectionPool } from "../tcpPool.js";
|
|
5
|
+
interface RateLimitContext {
|
|
6
|
+
name: string;
|
|
7
|
+
embedded: boolean;
|
|
8
|
+
tcp: TcpConnectionPool | null;
|
|
9
|
+
}
|
|
10
|
+
/** Set global concurrency limit */
|
|
11
|
+
export declare function setGlobalConcurrency(ctx: RateLimitContext, concurrency: number): void;
|
|
12
|
+
/** Set global concurrency limit and resolve once the server has applied it. */
|
|
13
|
+
export declare function setGlobalConcurrencyAsync(ctx: RateLimitContext, concurrency: number): Promise<void>;
|
|
14
|
+
/** Remove global concurrency limit */
|
|
15
|
+
export declare function removeGlobalConcurrency(ctx: RateLimitContext): void;
|
|
16
|
+
/** Remove global concurrency limit and resolve once the server has applied it. */
|
|
17
|
+
export declare function removeGlobalConcurrencyAsync(ctx: RateLimitContext): Promise<void>;
|
|
18
|
+
/** Get global concurrency limit */
|
|
19
|
+
export declare function getGlobalConcurrency(ctx: RateLimitContext): Promise<number | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Set global rate limit: `max` jobs per `duration` ms (default 1000ms).
|
|
22
|
+
* The window is honored in both embedded and TCP modes.
|
|
23
|
+
*/
|
|
24
|
+
export declare function setGlobalRateLimit(ctx: RateLimitContext, max: number, duration?: number): void;
|
|
25
|
+
/** Set global rate limit and resolve once the server has applied it. */
|
|
26
|
+
export declare function setGlobalRateLimitAsync(ctx: RateLimitContext, max: number, duration?: number): Promise<void>;
|
|
27
|
+
/** Remove global rate limit */
|
|
28
|
+
export declare function removeGlobalRateLimit(ctx: RateLimitContext): void;
|
|
29
|
+
/** Remove global rate limit and resolve once the server has applied it. */
|
|
30
|
+
export declare function removeGlobalRateLimitAsync(ctx: RateLimitContext): Promise<void>;
|
|
31
|
+
/** Get global rate limit */
|
|
32
|
+
export declare function getGlobalRateLimit(ctx: RateLimitContext): Promise<{
|
|
33
|
+
max: number;
|
|
34
|
+
duration: number;
|
|
35
|
+
} | null>;
|
|
36
|
+
/**
|
|
37
|
+
* Set temporary rate limit with expiration. The expiry lives broker-side
|
|
38
|
+
* (RateLimit `ttl`), so it survives client exit and works identically in
|
|
39
|
+
* embedded and TCP modes — no client timer involved.
|
|
40
|
+
*/
|
|
41
|
+
export declare function rateLimit(ctx: RateLimitContext, expireTimeMs: number): Promise<void>;
|
|
42
|
+
/** Get rate limit TTL */
|
|
43
|
+
export declare function getRateLimitTtl(ctx: RateLimitContext, maxJobs?: number): Promise<number>;
|
|
44
|
+
/** Check if queue is at max capacity */
|
|
45
|
+
export declare function isMaxed(ctx: RateLimitContext): Promise<boolean>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as workersOps from "../workers.js";
|
|
2
|
+
import { QueueScheduling } from "./scheduling.js";
|
|
3
|
+
/** BullMQ compatibility helpers plus worker and metrics inspection. */
|
|
4
|
+
export declare class QueueCompatibility<T> extends QueueScheduling<T> {
|
|
5
|
+
getPrioritized(start?: number, end?: number): Promise<import("../../index.js").Job<T>[]>;
|
|
6
|
+
getPrioritizedCount(): Promise<number>;
|
|
7
|
+
getWaitingChildren(start?: number, end?: number): Promise<import("../../index.js").Job<T>[]>;
|
|
8
|
+
getWaitingChildrenCount(): Promise<number>;
|
|
9
|
+
trimEvents(maxLength: number): Promise<number>;
|
|
10
|
+
getWorkers(): Promise<workersOps.WorkerInfo[]>;
|
|
11
|
+
getWorkersCount(): Promise<number>;
|
|
12
|
+
getMetrics(type: 'completed' | 'failed', start?: number, end?: number): Promise<import("../../index.js").QueueMetrics>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { DlqConfig, DlqEntry, DlqFilter, DlqStats, StallConfig } from "../../types.js";
|
|
2
|
+
import { QueueControl } from "./control.js";
|
|
3
|
+
/** Stall, DLQ, concurrency, and rate-limit configuration. */
|
|
4
|
+
export declare class QueueConfiguration<T> extends QueueControl<T> {
|
|
5
|
+
setStallConfig(config: Partial<StallConfig>): void;
|
|
6
|
+
setStallConfigAsync(config: Partial<StallConfig>): Promise<void>;
|
|
7
|
+
getStallConfig(): StallConfig;
|
|
8
|
+
getStallConfigAsync(): Promise<StallConfig>;
|
|
9
|
+
setDlqConfig(config: Partial<DlqConfig>): void;
|
|
10
|
+
setDlqConfigAsync(config: Partial<DlqConfig>): Promise<void>;
|
|
11
|
+
getDlqConfig(): DlqConfig;
|
|
12
|
+
getDlqConfigAsync(): Promise<DlqConfig>;
|
|
13
|
+
getDlq(filter?: DlqFilter): DlqEntry<T>[];
|
|
14
|
+
getDlqAsync(filter?: DlqFilter): Promise<DlqEntry<T>[]>;
|
|
15
|
+
getDlqJobsAsync(count?: number): Promise<import("../../index.js").Job<T>[]>;
|
|
16
|
+
getDlqStats(): DlqStats;
|
|
17
|
+
getDlqStatsAsync(): Promise<DlqStats>;
|
|
18
|
+
retryDlq(id?: string): number;
|
|
19
|
+
retryDlqAsync(id?: string): Promise<number>;
|
|
20
|
+
retryDlqByFilter(filter: DlqFilter): number;
|
|
21
|
+
retryDlqByFilterAsync(filter: DlqFilter): Promise<number>;
|
|
22
|
+
purgeDlq(): number;
|
|
23
|
+
purgeDlqAsync(): Promise<number>;
|
|
24
|
+
/** Remove one DLQ entry and resolve when the removal completes. */
|
|
25
|
+
removeDlqJob(id: string): Promise<boolean>;
|
|
26
|
+
/** Explicit async alias for removeDlqJob. */
|
|
27
|
+
removeDlqJobAsync(id: string): Promise<boolean>;
|
|
28
|
+
retryCompleted(id?: string): number;
|
|
29
|
+
retryCompletedAsync(id?: string): Promise<number>;
|
|
30
|
+
setGlobalConcurrency(concurrency: number): void;
|
|
31
|
+
setGlobalConcurrencyAsync(concurrency: number): Promise<void>;
|
|
32
|
+
removeGlobalConcurrency(): void;
|
|
33
|
+
removeGlobalConcurrencyAsync(): Promise<void>;
|
|
34
|
+
getGlobalConcurrency(): Promise<number | null>;
|
|
35
|
+
setGlobalRateLimit(max: number, duration?: number): void;
|
|
36
|
+
setGlobalRateLimitAsync(max: number, duration?: number): Promise<void>;
|
|
37
|
+
removeGlobalRateLimit(): void;
|
|
38
|
+
removeGlobalRateLimitAsync(): Promise<void>;
|
|
39
|
+
getGlobalRateLimit(): Promise<{
|
|
40
|
+
max: number;
|
|
41
|
+
duration: number;
|
|
42
|
+
} | null>;
|
|
43
|
+
rateLimit(expireTimeMs: number): Promise<void>;
|
|
44
|
+
getRateLimitTtl(maxJobs?: number): Promise<number>;
|
|
45
|
+
isMaxed(): Promise<boolean>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ChangePriorityOpts } from "../../types.js";
|
|
2
|
+
import { QueueQueries } from "./queries.js";
|
|
3
|
+
/** Queue lifecycle controls and individual job management operations. */
|
|
4
|
+
export declare class QueueControl<T> extends QueueQueries<T> {
|
|
5
|
+
pause(): void;
|
|
6
|
+
pauseAsync(): Promise<void>;
|
|
7
|
+
resume(): void;
|
|
8
|
+
resumeAsync(): Promise<void>;
|
|
9
|
+
drain(): void;
|
|
10
|
+
drainAsync(): Promise<number>;
|
|
11
|
+
obliterate(): void;
|
|
12
|
+
obliterateAsync(): Promise<void>;
|
|
13
|
+
isPaused(): boolean;
|
|
14
|
+
isPausedAsync(): Promise<boolean>;
|
|
15
|
+
waitUntilReady(): Promise<void>;
|
|
16
|
+
remove(id: string): void;
|
|
17
|
+
removeAsync(id: string): Promise<void>;
|
|
18
|
+
retryJob(id: string): Promise<void>;
|
|
19
|
+
retryJobs(opts?: {
|
|
20
|
+
state?: 'failed' | 'completed';
|
|
21
|
+
count?: number;
|
|
22
|
+
timestamp?: number;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
clean(grace: number, limit: number, type?: string): string[];
|
|
25
|
+
cleanAsync(grace: number, limit: number, type?: string): Promise<string[]>;
|
|
26
|
+
promoteJobs(opts?: {
|
|
27
|
+
count?: number;
|
|
28
|
+
}): Promise<number>;
|
|
29
|
+
promoteJob(id: string): Promise<void>;
|
|
30
|
+
updateJobProgress(id: string, progress: number | object): Promise<void>;
|
|
31
|
+
getJobLogs(id: string, start?: number, end?: number, _asc?: boolean): Promise<{
|
|
32
|
+
logs: string[];
|
|
33
|
+
count: number;
|
|
34
|
+
}>;
|
|
35
|
+
addJobLog(id: string, logRow: string, _keepLogs?: number): Promise<number>;
|
|
36
|
+
clearJobLogs(id: string, keepLogs?: number): Promise<void>;
|
|
37
|
+
updateJobData(id: string, data: unknown): Promise<void>;
|
|
38
|
+
changeJobDelay(id: string, delay: number): Promise<void>;
|
|
39
|
+
changeJobPriority(id: string, opts: ChangePriorityOpts): Promise<void>;
|
|
40
|
+
extendJobLock(id: string, token: string, duration: number): Promise<number>;
|
|
41
|
+
}
|