@fluojs/queue 1.0.0 → 1.0.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/README.ko.md +9 -1
- package/README.md +9 -1
- package/dist/decorators.d.ts.map +1 -1
- package/dist/decorators.js +1 -1
- package/package.json +5 -5
package/README.ko.md
CHANGED
|
@@ -129,14 +129,22 @@ Job은 JSON으로 직렬화 가능한 plain object여야 합니다. Queue는 enq
|
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
### 타입
|
|
132
|
-
- `
|
|
132
|
+
- `Queue`: 애플리케이션 코드와 `QUEUE` 토큰에서 사용하는 `enqueue(job)` 호환성 facade입니다.
|
|
133
|
+
- `QueueJobType`: job payload class를 식별하고 rehydrate하는 데 사용하는 constructor 타입입니다.
|
|
134
|
+
- `QueueModuleOptions`: 전역 큐 설정(`global`, clientName, 기본 시도 횟수, `defaultBackoff`, 동시성, 전송률 제한, dead-letter retention 등)을 위한 타입입니다.
|
|
133
135
|
- `QueueWorkerOptions`: 개별 작업 설정(시도 횟수, 백오프, 동시성, jobName, 전송률 제한 등)을 위한 타입입니다.
|
|
136
|
+
- `QueueBackoffType`: 지원되는 retry backoff strategy 이름(`fixed`, `exponential`)입니다.
|
|
134
137
|
- `QueueBackoffOptions`: 재시도 백오프 설정(`type`, `delayMs`)을 위한 타입입니다.
|
|
138
|
+
- `QueueRateLimiterOptions`: worker 수준 distributed rate limiter 설정(`max`, `duration`)을 위한 타입입니다.
|
|
139
|
+
- `QueueLifecycleState`: Queue status adapter가 보고하는 lifecycle state(`idle`, `starting`, `started`, `stopping`, `stopped`)입니다.
|
|
140
|
+
- `QueueStatusAdapterInput`: `createQueuePlatformStatusSnapshot(...)`에 전달하는 normalized queue metrics 타입입니다.
|
|
141
|
+
- `QueuePlatformStatusSnapshot`: status helper가 반환하는 Queue 전용 readiness, health, ownership, detail snapshot 타입입니다.
|
|
135
142
|
|
|
136
143
|
`QueueModuleOptions`에는 `workerShutdownTimeoutMs`, `defaultDeadLetterMaxEntries` 같은 lifecycle 및 dead-letter retention 설정도 포함됩니다.
|
|
137
144
|
|
|
138
145
|
`QueueModuleOptions` 수명 주기/status 설정:
|
|
139
146
|
|
|
147
|
+
- `global`: queue module 등록을 global로 만들지 여부입니다. 기본값은 `true`이며, queue provider를 importing module graph 안에만 scope하고 싶으면 `false`를 지정합니다.
|
|
140
148
|
- `workerShutdownTimeoutMs`: 종료 중 active worker processor를 기다리는 최대 시간입니다. 시간이 지나면 BullMQ worker를 force-close합니다. 기본값은 `30_000`입니다.
|
|
141
149
|
- `defaultDeadLetterMaxEntries`: job별로 유지할 dead-letter record의 최대 개수이며, trimming을 끄려면 `false`를 지정합니다. 기본값은 `1_000`입니다.
|
|
142
150
|
|
package/README.md
CHANGED
|
@@ -129,14 +129,22 @@ Treat low-level provider assembly as an internal implementation detail: low-leve
|
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
### Types
|
|
132
|
-
- `
|
|
132
|
+
- `Queue`: Compatibility facade with `enqueue(job)` for application code and the `QUEUE` token.
|
|
133
|
+
- `QueueJobType`: Constructor type used to identify and rehydrate a job payload class.
|
|
134
|
+
- `QueueModuleOptions`: Global queue settings (`global`, clientName, default attempts, `defaultBackoff`, concurrency, rate limiting, dead-letter retention).
|
|
133
135
|
- `QueueWorkerOptions`: Per-job settings (attempts, backoff, concurrency, jobName, rate limiting).
|
|
136
|
+
- `QueueBackoffType`: Supported retry backoff strategy names (`fixed`, `exponential`).
|
|
134
137
|
- `QueueBackoffOptions`: Retry backoff settings (`type`, `delayMs`).
|
|
138
|
+
- `QueueRateLimiterOptions`: Worker-level distributed rate limiter settings (`max`, `duration`).
|
|
139
|
+
- `QueueLifecycleState`: Lifecycle states reported by Queue status adapters (`idle`, `starting`, `started`, `stopping`, `stopped`).
|
|
140
|
+
- `QueueStatusAdapterInput`: Normalized queue metrics passed to `createQueuePlatformStatusSnapshot(...)`.
|
|
141
|
+
- `QueuePlatformStatusSnapshot`: Queue-specific readiness, health, ownership, and detail snapshot returned by the status helper.
|
|
135
142
|
|
|
136
143
|
`QueueModuleOptions` also includes lifecycle and dead-letter retention controls such as `workerShutdownTimeoutMs` and `defaultDeadLetterMaxEntries`.
|
|
137
144
|
|
|
138
145
|
`QueueModuleOptions` lifecycle/status controls:
|
|
139
146
|
|
|
147
|
+
- `global`: whether the queue module registration is global. Defaults to `true`; set `false` when queue providers should stay scoped to the importing module graph.
|
|
140
148
|
- `workerShutdownTimeoutMs`: maximum time to wait for active worker processors during shutdown before force-closing the BullMQ worker. Defaults to `30_000`.
|
|
141
149
|
- `defaultDeadLetterMaxEntries`: maximum retained dead-letter records per job, or `false` to disable trimming. Defaults to `1_000`.
|
|
142
150
|
|
package/dist/decorators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAuB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAExF,KAAK,kBAAkB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAuB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAExF,KAAK,kBAAkB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAepF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,GAAE,kBAAuB,GAAG,kBAAkB,CAavG"}
|
package/dist/decorators.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ensureMetadataSymbol } from '@fluojs/core/internal';
|
|
2
2
|
import { queueWorkerMetadataSymbol } from './metadata.js';
|
|
3
|
-
ensureMetadataSymbol();
|
|
4
3
|
function getStandardMetadataBag(metadata) {
|
|
5
4
|
return metadata;
|
|
6
5
|
}
|
|
@@ -39,6 +38,7 @@ function defineStandardQueueWorkerMetadata(metadata, workerMetadata) {
|
|
|
39
38
|
*/
|
|
40
39
|
export function QueueWorker(jobType, options = {}) {
|
|
41
40
|
const decorator = (_value, context) => {
|
|
41
|
+
ensureMetadataSymbol();
|
|
42
42
|
const metadata = {
|
|
43
43
|
jobType,
|
|
44
44
|
options: {
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"redis",
|
|
11
11
|
"dlq"
|
|
12
12
|
],
|
|
13
|
-
"version": "1.0.
|
|
13
|
+
"version": "1.0.1",
|
|
14
14
|
"private": false,
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"bullmq": "^5.58.0",
|
|
41
|
-
"@fluojs/core": "^1.0.
|
|
42
|
-
"@fluojs/
|
|
43
|
-
"@fluojs/
|
|
44
|
-
"@fluojs/
|
|
41
|
+
"@fluojs/core": "^1.0.3",
|
|
42
|
+
"@fluojs/di": "^1.0.3",
|
|
43
|
+
"@fluojs/redis": "^1.0.1",
|
|
44
|
+
"@fluojs/runtime": "^1.1.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"vitest": "^3.2.4"
|