@neofinancial/chrono 0.1.1 → 0.2.0
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/build/chrono.d.ts +2 -1
- package/build/chrono.js +4 -5
- package/build/chrono.js.map +1 -1
- package/build/events.d.ts +16 -0
- package/build/events.js +10 -0
- package/build/events.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +5 -1
- package/build/index.js.map +1 -1
- package/build/processors/create-processor.d.ts +1 -0
- package/build/processors/create-processor.js +1 -12
- package/build/processors/create-processor.js.map +1 -1
- package/build/processors/events.d.ts +50 -0
- package/build/processors/events.js +19 -0
- package/build/processors/events.js.map +1 -0
- package/build/processors/index.d.ts +1 -0
- package/build/processors/index.js +3 -1
- package/build/processors/index.js.map +1 -1
- package/build/processors/processor.d.ts +3 -31
- package/build/processors/simple-processor.d.ts +16 -23
- package/build/processors/simple-processor.js +45 -44
- package/build/processors/simple-processor.js.map +1 -1
- package/package.json +3 -2
package/build/chrono.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:stream';
|
|
2
2
|
import type { BackoffStrategyOptions } from './backoff-strategy';
|
|
3
3
|
import type { Datastore, ScheduleInput, Task } from './datastore';
|
|
4
|
+
import { type ChronoEventsMap } from './events';
|
|
4
5
|
import { type Processor } from './processors';
|
|
5
6
|
import type { ProcessorConfiguration } from './processors/create-processor';
|
|
6
7
|
export type TaskMappingBase = Record<string, unknown>;
|
|
@@ -22,7 +23,7 @@ export type RegisterTaskHandlerInput<TaskKind, TaskData> = {
|
|
|
22
23
|
* };
|
|
23
24
|
*
|
|
24
25
|
*/
|
|
25
|
-
export declare class Chrono<TaskMapping extends TaskMappingBase, DatastoreOptions> extends EventEmitter {
|
|
26
|
+
export declare class Chrono<TaskMapping extends TaskMappingBase, DatastoreOptions> extends EventEmitter<ChronoEventsMap> {
|
|
26
27
|
private datastore;
|
|
27
28
|
private processors;
|
|
28
29
|
readonly exitTimeoutMs = 60000;
|
package/build/chrono.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Chrono = void 0;
|
|
4
4
|
const node_stream_1 = require("node:stream");
|
|
5
|
+
const events_1 = require("./events");
|
|
5
6
|
const processors_1 = require("./processors");
|
|
6
7
|
const promise_utils_1 = require("./utils/promise-utils");
|
|
7
8
|
/**
|
|
@@ -27,7 +28,7 @@ class Chrono extends node_stream_1.EventEmitter {
|
|
|
27
28
|
for (const processor of this.processors.values()) {
|
|
28
29
|
await processor.start();
|
|
29
30
|
}
|
|
30
|
-
this.emit(
|
|
31
|
+
this.emit(events_1.ChronoEvents.STARTED, { startedAt: new Date() });
|
|
31
32
|
}
|
|
32
33
|
async stop() {
|
|
33
34
|
const stopPromises = Array.from(this.processors.values()).map((processor) => processor.stop());
|
|
@@ -35,10 +36,7 @@ class Chrono extends node_stream_1.EventEmitter {
|
|
|
35
36
|
await (0, promise_utils_1.promiseWithTimeout)(Promise.all(stopPromises), this.exitTimeoutMs);
|
|
36
37
|
}
|
|
37
38
|
catch (error) {
|
|
38
|
-
this.emit(
|
|
39
|
-
}
|
|
40
|
-
finally {
|
|
41
|
-
this.emit('close', { timestamp: new Date() });
|
|
39
|
+
this.emit(events_1.ChronoEvents.STOP_ABORTED, { error, timestamp: new Date() });
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
async scheduleTask(input) {
|
|
@@ -62,6 +60,7 @@ class Chrono extends node_stream_1.EventEmitter {
|
|
|
62
60
|
kind: input.kind,
|
|
63
61
|
datastore: this.datastore,
|
|
64
62
|
handler: input.handler,
|
|
63
|
+
backoffStrategyOptions: input.backoffStrategyOptions,
|
|
65
64
|
configuration: input.processorConfiguration,
|
|
66
65
|
});
|
|
67
66
|
this.processors.set(input.kind, processor);
|
package/build/chrono.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chr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readonly STARTED: "started";
|
|
4
|
+
/** Chrono instance has failed to gracefully stop so shutdown has been aborted */
|
|
5
|
+
readonly STOP_ABORTED: "stopAborted";
|
|
6
|
+
};
|
|
7
|
+
export type ChronoEvents = (typeof ChronoEvents)[keyof typeof ChronoEvents];
|
|
8
|
+
export type ChronoEventsMap = {
|
|
9
|
+
[ChronoEvents.STARTED]: [{
|
|
10
|
+
startedAt: Date;
|
|
11
|
+
}];
|
|
12
|
+
[ChronoEvents.STOP_ABORTED]: [{
|
|
13
|
+
timestamp: Date;
|
|
14
|
+
error: unknown;
|
|
15
|
+
}];
|
|
16
|
+
};
|
package/build/events.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChronoEvents = void 0;
|
|
4
|
+
exports.ChronoEvents = {
|
|
5
|
+
/** Chrono instance has started processors and begun polling tasks */
|
|
6
|
+
STARTED: 'started',
|
|
7
|
+
/** Chrono instance has failed to gracefully stop so shutdown has been aborted */
|
|
8
|
+
STOP_ABORTED: 'stopAborted',
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,qEAAqE;IACrE,OAAO,EAAE,SAAS;IAClB,iFAAiF;IACjF,YAAY,EAAE,aAAa;CACnB,CAAC"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { Chrono, type ScheduleTaskInput, type TaskMappingBase } from './chrono';
|
|
2
|
+
export { ChronoEvents } from './events';
|
|
3
|
+
export { ProcessorEvents } from './processors';
|
|
2
4
|
export { TaskStatus, type ClaimTaskInput, type Datastore, type ScheduleInput, type Task, type DeleteInput, type DeleteOptions, type DeleteByIdempotencyKeyInput, } from './datastore';
|
package/build/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskStatus = exports.Chrono = void 0;
|
|
3
|
+
exports.TaskStatus = exports.ProcessorEvents = exports.ChronoEvents = exports.Chrono = void 0;
|
|
4
4
|
var chrono_1 = require("./chrono");
|
|
5
5
|
Object.defineProperty(exports, "Chrono", { enumerable: true, get: function () { return chrono_1.Chrono; } });
|
|
6
|
+
var events_1 = require("./events");
|
|
7
|
+
Object.defineProperty(exports, "ChronoEvents", { enumerable: true, get: function () { return events_1.ChronoEvents; } });
|
|
8
|
+
var processors_1 = require("./processors");
|
|
9
|
+
Object.defineProperty(exports, "ProcessorEvents", { enumerable: true, get: function () { return processors_1.ProcessorEvents; } });
|
|
6
10
|
var datastore_1 = require("./datastore");
|
|
7
11
|
Object.defineProperty(exports, "TaskStatus", { enumerable: true, get: function () { return datastore_1.TaskStatus; } });
|
|
8
12
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgF;AAAvE,gGAAA,MAAM,OAAA;AACf,yCASqB;AARnB,uGAAA,UAAU,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAgF;AAAvE,gGAAA,MAAM,OAAA;AACf,mCAAwC;AAA/B,sGAAA,YAAY,OAAA;AACrB,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AAExB,yCASqB;AARnB,uGAAA,UAAU,OAAA"}
|
|
@@ -9,6 +9,7 @@ export type ProcessorConfiguration = {
|
|
|
9
9
|
idleIntervalMs?: number;
|
|
10
10
|
taskHandlerTimeoutMs?: number;
|
|
11
11
|
taskHandlerMaxRetries?: number;
|
|
12
|
+
processLoopRetryIntervalMs?: number;
|
|
12
13
|
};
|
|
13
14
|
export type CreateProcessorInput<TaskKind extends keyof TaskMapping, TaskMapping extends TaskMappingBase, DatastoreOptions> = {
|
|
14
15
|
kind: TaskKind;
|
|
@@ -6,17 +6,6 @@ const simple_processor_1 = require("./simple-processor");
|
|
|
6
6
|
function createProcessor(input) {
|
|
7
7
|
const backoffStrategy = (0, backoff_strategy_1.backoffStrategyFactory)(input.backoffStrategyOptions);
|
|
8
8
|
// add more processors here
|
|
9
|
-
return new simple_processor_1.SimpleProcessor(
|
|
10
|
-
datastore: input.datastore,
|
|
11
|
-
kind: input.kind,
|
|
12
|
-
handler: input.handler,
|
|
13
|
-
maxConcurrency: input.configuration?.maxConcurrency,
|
|
14
|
-
backoffStrategy,
|
|
15
|
-
claimIntervalMs: input.configuration?.claimIntervalMs,
|
|
16
|
-
idleIntervalMs: input.configuration?.idleIntervalMs,
|
|
17
|
-
taskHandlerTimeoutMs: input.configuration?.taskHandlerTimeoutMs,
|
|
18
|
-
claimStaleTimeoutMs: input.configuration?.claimStaleTimeoutMs,
|
|
19
|
-
taskHandlerMaxRetries: input.configuration?.taskHandlerMaxRetries,
|
|
20
|
-
});
|
|
9
|
+
return new simple_processor_1.SimpleProcessor(input.datastore, input.kind, input.handler, backoffStrategy, input.configuration);
|
|
21
10
|
}
|
|
22
11
|
//# sourceMappingURL=create-processor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-processor.js","sourceRoot":"","sources":["../../src/processors/create-processor.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"create-processor.js","sourceRoot":"","sources":["../../src/processors/create-processor.ts"],"names":[],"mappings":";;AA4BA,0CAcC;AAxCD,0DAA0F;AAE1F,yDAAqD;AAwBrD,SAAgB,eAAe,CAI7B,KAAoE;IACpE,MAAM,eAAe,GAAG,IAAA,yCAAsB,EAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC7E,2BAA2B;IAC3B,OAAO,IAAI,kCAAe,CACxB,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,OAAO,EACb,eAAe,EACf,KAAK,CAAC,aAAa,CACpB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Task, TaskMappingBase } from '..';
|
|
2
|
+
export declare const ProcessorEvents: {
|
|
3
|
+
/** A task has been claimed by the running processor for handling */
|
|
4
|
+
readonly TASK_CLAIMED: "taskClaimed";
|
|
5
|
+
/** A task has completed processing and successfully marked as completed */
|
|
6
|
+
readonly TASK_COMPLETED: "taskCompleted";
|
|
7
|
+
/** A task has failed during processing and being scheduled for retry */
|
|
8
|
+
readonly TASK_RETRY_SCHEDULED: "taskRetryScheduled";
|
|
9
|
+
/** A task has been marked as FAILED due to process failures exceeding max retries */
|
|
10
|
+
readonly TASK_FAILED: "taskFailed";
|
|
11
|
+
/** A task has been successfully processed but underlying data store failed to mark task as completed. Duplicate processing expected */
|
|
12
|
+
readonly TASK_COMPLETION_FAILURE: "taskCompletionFailure";
|
|
13
|
+
/** An unknown and uncaught exception occurred in processor. Processing paused for processLoopRetryIntervalMs before continuing */
|
|
14
|
+
readonly UNKNOWN_PROCESSING_ERROR: "unknownProcessingError";
|
|
15
|
+
};
|
|
16
|
+
export type ProcessorEvents = (typeof ProcessorEvents)[keyof typeof ProcessorEvents];
|
|
17
|
+
export type ProcessorEventsMap<TaskKind extends keyof TaskMapping, TaskMapping extends TaskMappingBase> = {
|
|
18
|
+
[ProcessorEvents.TASK_CLAIMED]: [{
|
|
19
|
+
task: Task<TaskKind, TaskMapping[TaskKind]>;
|
|
20
|
+
claimedAt: Date;
|
|
21
|
+
}];
|
|
22
|
+
[ProcessorEvents.TASK_COMPLETED]: [{
|
|
23
|
+
task: Task<TaskKind, TaskMapping[TaskKind]>;
|
|
24
|
+
completedAt: Date;
|
|
25
|
+
}];
|
|
26
|
+
[ProcessorEvents.TASK_RETRY_SCHEDULED]: [
|
|
27
|
+
{
|
|
28
|
+
task: Task<TaskKind, TaskMapping[TaskKind]>;
|
|
29
|
+
error: unknown;
|
|
30
|
+
retryScheduledAt: Date;
|
|
31
|
+
errorAt: Date;
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
[ProcessorEvents.TASK_FAILED]: [{
|
|
35
|
+
task: Task<TaskKind, TaskMapping[TaskKind]>;
|
|
36
|
+
error: unknown;
|
|
37
|
+
failedAt: Date;
|
|
38
|
+
}];
|
|
39
|
+
[ProcessorEvents.TASK_COMPLETION_FAILURE]: [
|
|
40
|
+
{
|
|
41
|
+
task: Task<TaskKind, TaskMapping[TaskKind]>;
|
|
42
|
+
error: unknown;
|
|
43
|
+
failedAt: Date;
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
[ProcessorEvents.UNKNOWN_PROCESSING_ERROR]: [{
|
|
47
|
+
error: unknown;
|
|
48
|
+
timestamp: Date;
|
|
49
|
+
}];
|
|
50
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProcessorEvents = void 0;
|
|
4
|
+
exports.ProcessorEvents = {
|
|
5
|
+
/** A task has been claimed by the running processor for handling */
|
|
6
|
+
TASK_CLAIMED: 'taskClaimed',
|
|
7
|
+
/** A task has completed processing and successfully marked as completed */
|
|
8
|
+
TASK_COMPLETED: 'taskCompleted',
|
|
9
|
+
/** A task has failed during processing and being scheduled for retry */
|
|
10
|
+
TASK_RETRY_SCHEDULED: 'taskRetryScheduled',
|
|
11
|
+
/** A task has been marked as FAILED due to process failures exceeding max retries */
|
|
12
|
+
TASK_FAILED: 'taskFailed',
|
|
13
|
+
/** A task has been successfully processed but underlying data store failed to mark task as completed. Duplicate processing expected */
|
|
14
|
+
TASK_COMPLETION_FAILURE: 'taskCompletionFailure',
|
|
15
|
+
/** An unknown and uncaught exception occurred in processor. Processing paused for processLoopRetryIntervalMs before continuing */
|
|
16
|
+
UNKNOWN_PROCESSING_ERROR: 'unknownProcessingError',
|
|
17
|
+
};
|
|
18
|
+
exports.ProcessorEvents.TASK_CLAIMED;
|
|
19
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/processors/events.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAG;IAC7B,oEAAoE;IACpE,YAAY,EAAE,aAAa;IAC3B,2EAA2E;IAC3E,cAAc,EAAE,eAAe;IAC/B,wEAAwE;IACxE,oBAAoB,EAAE,oBAAoB;IAC1C,qFAAqF;IACrF,WAAW,EAAE,YAAY;IACzB,uIAAuI;IACvI,uBAAuB,EAAE,uBAAuB;IAChD,kIAAkI;IAClI,wBAAwB,EAAE,wBAAwB;CAC1C,CAAC;AAiBX,uBAAe,CAAC,YAAY,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createProcessor = void 0;
|
|
3
|
+
exports.ProcessorEvents = exports.createProcessor = void 0;
|
|
4
4
|
var create_processor_1 = require("./create-processor");
|
|
5
5
|
Object.defineProperty(exports, "createProcessor", { enumerable: true, get: function () { return create_processor_1.createProcessor; } });
|
|
6
|
+
var events_1 = require("./events");
|
|
7
|
+
Object.defineProperty(exports, "ProcessorEvents", { enumerable: true, get: function () { return events_1.ProcessorEvents; } });
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/processors/index.ts"],"names":[],"mappings":";;;AAAA,uDAAqD;AAA5C,mHAAA,eAAe,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/processors/index.ts"],"names":[],"mappings":";;;AAAA,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AAExB,mCAA2C;AAAlC,yGAAA,eAAe,OAAA"}
|
|
@@ -1,35 +1,7 @@
|
|
|
1
1
|
import type { EventEmitter } from 'node:stream';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
task: Task<TaskKind, TaskMapping[TaskKind]>;
|
|
6
|
-
timestamp: Date;
|
|
7
|
-
}];
|
|
8
|
-
'task:completed': [{
|
|
9
|
-
task: Task<TaskKind, TaskMapping[TaskKind]>;
|
|
10
|
-
timestamp: Date;
|
|
11
|
-
}];
|
|
12
|
-
'task:failed': [{
|
|
13
|
-
task: Task<TaskKind, TaskMapping[TaskKind]>;
|
|
14
|
-
error: Error;
|
|
15
|
-
timestamp: Date;
|
|
16
|
-
}];
|
|
17
|
-
'task:retry:requested': [{
|
|
18
|
-
task: Task<TaskKind, TaskMapping[TaskKind]>;
|
|
19
|
-
error: Error;
|
|
20
|
-
timestamp: Date;
|
|
21
|
-
}];
|
|
22
|
-
'task:completion:failed': [{
|
|
23
|
-
task: Task<TaskKind, TaskMapping[TaskKind]>;
|
|
24
|
-
error: Error;
|
|
25
|
-
timestamp: Date;
|
|
26
|
-
}];
|
|
27
|
-
'processloop:error': [{
|
|
28
|
-
error: Error;
|
|
29
|
-
timestamp: Date;
|
|
30
|
-
}];
|
|
31
|
-
};
|
|
32
|
-
export interface Processor<TaskKind extends keyof TaskMapping, TaskMapping extends TaskMappingBase> extends EventEmitter<ProcessorEvents<TaskKind, TaskMapping>> {
|
|
2
|
+
import type { TaskMappingBase } from '..';
|
|
3
|
+
import type { ProcessorEventsMap } from './events';
|
|
4
|
+
export interface Processor<TaskKind extends keyof TaskMapping, TaskMapping extends TaskMappingBase> extends EventEmitter<ProcessorEventsMap<TaskKind, TaskMapping>> {
|
|
33
5
|
start(): Promise<void>;
|
|
34
6
|
stop(): Promise<void>;
|
|
35
7
|
}
|
|
@@ -2,33 +2,26 @@ import { EventEmitter } from 'node:stream';
|
|
|
2
2
|
import type { BackoffStrategy } from '../backoff-strategy';
|
|
3
3
|
import type { TaskMappingBase } from '../chrono';
|
|
4
4
|
import type { Datastore, Task } from '../datastore';
|
|
5
|
-
import
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
taskHandlerTimeoutMs?: number;
|
|
16
|
-
taskHandlerMaxRetries?: number;
|
|
5
|
+
import { type ProcessorEventsMap } from './events';
|
|
6
|
+
import type { Processor } from './processor';
|
|
7
|
+
type SimpleProcessorConfig = {
|
|
8
|
+
maxConcurrency: number;
|
|
9
|
+
claimIntervalMs: number;
|
|
10
|
+
claimStaleTimeoutMs: number;
|
|
11
|
+
idleIntervalMs: number;
|
|
12
|
+
taskHandlerTimeoutMs: number;
|
|
13
|
+
taskHandlerMaxRetries: number;
|
|
14
|
+
processLoopRetryIntervalMs: number;
|
|
17
15
|
};
|
|
18
|
-
export declare class SimpleProcessor<TaskKind extends Extract<keyof TaskMapping, string>, TaskMapping extends TaskMappingBase, DatastoreOptions> extends EventEmitter<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
private maxConcurrency;
|
|
16
|
+
export declare class SimpleProcessor<TaskKind extends Extract<keyof TaskMapping, string>, TaskMapping extends TaskMappingBase, DatastoreOptions> extends EventEmitter<ProcessorEventsMap<TaskKind, TaskMapping>> implements Processor<TaskKind, TaskMapping> {
|
|
17
|
+
private datastore;
|
|
18
|
+
private taskKind;
|
|
19
|
+
private handler;
|
|
23
20
|
private backOffStrategy;
|
|
24
|
-
|
|
25
|
-
readonly claimStaleTimeoutMs: number;
|
|
26
|
-
readonly idleIntervalMs: number;
|
|
27
|
-
readonly taskHandlerTimeoutMs: number;
|
|
28
|
-
readonly taskHandlerMaxRetries: number;
|
|
21
|
+
private config;
|
|
29
22
|
private exitChannels;
|
|
30
23
|
private stopRequested;
|
|
31
|
-
constructor(
|
|
24
|
+
constructor(datastore: Datastore<TaskMapping, DatastoreOptions>, taskKind: TaskKind, handler: (task: Task<TaskKind, TaskMapping[TaskKind]>) => Promise<void>, backOffStrategy: BackoffStrategy, config?: Partial<SimpleProcessorConfig>);
|
|
32
25
|
/**
|
|
33
26
|
* Validates that the task handler timeout is less than the claim stale timeout.
|
|
34
27
|
* Throws an error if the validation fails.
|
|
@@ -4,37 +4,35 @@ exports.SimpleProcessor = void 0;
|
|
|
4
4
|
const node_stream_1 = require("node:stream");
|
|
5
5
|
const promises_1 = require("node:timers/promises");
|
|
6
6
|
const promise_utils_1 = require("../utils/promise-utils");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const events_1 = require("./events");
|
|
8
|
+
const DEFAULT_CONFIG = {
|
|
9
|
+
maxConcurrency: 1,
|
|
10
|
+
claimIntervalMs: 50,
|
|
11
|
+
claimStaleTimeoutMs: 10_000,
|
|
12
|
+
idleIntervalMs: 5_000,
|
|
13
|
+
taskHandlerTimeoutMs: 5_000,
|
|
14
|
+
taskHandlerMaxRetries: 10,
|
|
15
|
+
processLoopRetryIntervalMs: 20_000,
|
|
16
|
+
};
|
|
17
|
+
const InternalProcessorEvents = { PROCESSOR_LOOP_EXIT: 'processorLoopExit' };
|
|
13
18
|
class SimpleProcessor extends node_stream_1.EventEmitter {
|
|
14
|
-
taskKind;
|
|
15
19
|
datastore;
|
|
20
|
+
taskKind;
|
|
16
21
|
handler;
|
|
17
|
-
maxConcurrency;
|
|
18
22
|
backOffStrategy;
|
|
19
|
-
|
|
20
|
-
claimStaleTimeoutMs;
|
|
21
|
-
idleIntervalMs;
|
|
22
|
-
taskHandlerTimeoutMs;
|
|
23
|
-
taskHandlerMaxRetries;
|
|
23
|
+
config;
|
|
24
24
|
exitChannels = [];
|
|
25
25
|
stopRequested = false;
|
|
26
|
-
constructor(config) {
|
|
26
|
+
constructor(datastore, taskKind, handler, backOffStrategy, config) {
|
|
27
27
|
super();
|
|
28
|
-
this.datastore =
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.backOffStrategy =
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.taskHandlerTimeoutMs = config.taskHandlerTimeoutMs || DEFAULT_TASK_HANDLER_TIMEOUT_MS;
|
|
37
|
-
this.taskHandlerMaxRetries = config.taskHandlerMaxRetries || DEFAULT_TASK_HANDLER_MAX_RETRIES;
|
|
28
|
+
this.datastore = datastore;
|
|
29
|
+
this.taskKind = taskKind;
|
|
30
|
+
this.handler = handler;
|
|
31
|
+
this.backOffStrategy = backOffStrategy;
|
|
32
|
+
this.config = {
|
|
33
|
+
...DEFAULT_CONFIG,
|
|
34
|
+
...config,
|
|
35
|
+
};
|
|
38
36
|
this.validatedHandlerTimeout();
|
|
39
37
|
}
|
|
40
38
|
/**
|
|
@@ -46,8 +44,8 @@ class SimpleProcessor extends node_stream_1.EventEmitter {
|
|
|
46
44
|
* @throws {Error} If the task handler timeout is greater than or equal to the claim stale timeout.
|
|
47
45
|
*/
|
|
48
46
|
validatedHandlerTimeout() {
|
|
49
|
-
if (this.taskHandlerTimeoutMs >= this.claimStaleTimeoutMs) {
|
|
50
|
-
throw new Error(`Task handler timeout (${this.taskHandlerTimeoutMs}ms) must be less than the claim stale timeout (${this.claimStaleTimeoutMs}ms)`);
|
|
47
|
+
if (this.config.taskHandlerTimeoutMs >= this.config.claimStaleTimeoutMs) {
|
|
48
|
+
throw new Error(`Task handler timeout (${this.config.taskHandlerTimeoutMs}ms) must be less than the claim stale timeout (${this.config.claimStaleTimeoutMs}ms)`);
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
/**
|
|
@@ -58,7 +56,7 @@ class SimpleProcessor extends node_stream_1.EventEmitter {
|
|
|
58
56
|
if (this.stopRequested || this.exitChannels.length > 0) {
|
|
59
57
|
return;
|
|
60
58
|
}
|
|
61
|
-
for (let i = 0; i < this.maxConcurrency; i++) {
|
|
59
|
+
for (let i = 0; i < this.config.maxConcurrency; i++) {
|
|
62
60
|
const exitChannel = new node_stream_1.EventEmitter();
|
|
63
61
|
this.exitChannels.push(exitChannel);
|
|
64
62
|
this.runProcessLoop(exitChannel);
|
|
@@ -69,7 +67,7 @@ class SimpleProcessor extends node_stream_1.EventEmitter {
|
|
|
69
67
|
* then waits for all process loops to finish before resolving.
|
|
70
68
|
*/
|
|
71
69
|
async stop() {
|
|
72
|
-
const exitPromises = this.exitChannels.map((channel) => new Promise((resolve) => channel.once(
|
|
70
|
+
const exitPromises = this.exitChannels.map((channel) => new Promise((resolve) => channel.once(InternalProcessorEvents.PROCESSOR_LOOP_EXIT, () => resolve(null))));
|
|
73
71
|
this.stopRequested = true;
|
|
74
72
|
await Promise.all(exitPromises);
|
|
75
73
|
}
|
|
@@ -83,24 +81,25 @@ class SimpleProcessor extends node_stream_1.EventEmitter {
|
|
|
83
81
|
try {
|
|
84
82
|
const task = await this.datastore.claim({
|
|
85
83
|
kind: this.taskKind,
|
|
86
|
-
claimStaleTimeoutMs: this.claimStaleTimeoutMs,
|
|
84
|
+
claimStaleTimeoutMs: this.config.claimStaleTimeoutMs,
|
|
87
85
|
});
|
|
88
86
|
// If no tasks are available, wait before trying again
|
|
89
87
|
if (!task) {
|
|
90
|
-
await (0, promises_1.setTimeout)(this.idleIntervalMs);
|
|
88
|
+
await (0, promises_1.setTimeout)(this.config.idleIntervalMs);
|
|
91
89
|
continue;
|
|
92
90
|
}
|
|
93
|
-
this.emit(
|
|
91
|
+
this.emit(events_1.ProcessorEvents.TASK_CLAIMED, { task, claimedAt: task.claimedAt || new Date() });
|
|
94
92
|
// Process the task using the handler
|
|
95
93
|
await this.handleTask(task);
|
|
96
94
|
// Wait a bit before claiming the next task
|
|
97
|
-
await (0, promises_1.setTimeout)(this.claimIntervalMs);
|
|
95
|
+
await (0, promises_1.setTimeout)(this.config.claimIntervalMs);
|
|
98
96
|
}
|
|
99
97
|
catch (error) {
|
|
100
|
-
this.emit(
|
|
98
|
+
this.emit(events_1.ProcessorEvents.UNKNOWN_PROCESSING_ERROR, { error, timestamp: new Date() });
|
|
99
|
+
await (0, promises_1.setTimeout)(this.config.processLoopRetryIntervalMs);
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
|
-
exitChannel.emit(
|
|
102
|
+
exitChannel.emit(InternalProcessorEvents.PROCESSOR_LOOP_EXIT);
|
|
104
103
|
}
|
|
105
104
|
/**
|
|
106
105
|
* Handles a task by calling the handler and marking it as complete or failed.
|
|
@@ -114,7 +113,7 @@ class SimpleProcessor extends node_stream_1.EventEmitter {
|
|
|
114
113
|
*/
|
|
115
114
|
async handleTask(task) {
|
|
116
115
|
try {
|
|
117
|
-
await (0, promise_utils_1.promiseWithTimeout)(this.handler(task), this.taskHandlerTimeoutMs);
|
|
116
|
+
await (0, promise_utils_1.promiseWithTimeout)(this.handler(task), this.config.taskHandlerTimeoutMs);
|
|
118
117
|
}
|
|
119
118
|
catch (error) {
|
|
120
119
|
await this.handleTaskError(task, error);
|
|
@@ -122,37 +121,39 @@ class SimpleProcessor extends node_stream_1.EventEmitter {
|
|
|
122
121
|
}
|
|
123
122
|
try {
|
|
124
123
|
const completedTask = await this.datastore.complete(task.id);
|
|
125
|
-
this.emit(
|
|
124
|
+
this.emit(events_1.ProcessorEvents.TASK_COMPLETED, {
|
|
126
125
|
task: completedTask,
|
|
127
|
-
|
|
126
|
+
completedAt: completedTask.completedAt || new Date(),
|
|
128
127
|
});
|
|
129
128
|
}
|
|
130
129
|
catch (error) {
|
|
131
|
-
this.emit(
|
|
130
|
+
this.emit(events_1.ProcessorEvents.TASK_COMPLETION_FAILURE, {
|
|
132
131
|
error: error,
|
|
132
|
+
failedAt: new Date(),
|
|
133
133
|
task,
|
|
134
|
-
timestamp: new Date(),
|
|
135
134
|
});
|
|
136
135
|
}
|
|
137
136
|
}
|
|
138
137
|
async handleTaskError(task, error) {
|
|
139
|
-
|
|
138
|
+
const failedAt = new Date();
|
|
139
|
+
if (task.retryCount >= this.config.taskHandlerMaxRetries) {
|
|
140
140
|
// Mark the task as failed
|
|
141
141
|
await this.datastore.fail(task.id);
|
|
142
|
-
this.emit(
|
|
142
|
+
this.emit(events_1.ProcessorEvents.TASK_FAILED, {
|
|
143
143
|
task,
|
|
144
144
|
error,
|
|
145
|
-
|
|
145
|
+
failedAt,
|
|
146
146
|
});
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
const delay = this.backOffStrategy({ retryAttempt: task.retryCount });
|
|
150
150
|
const retryAt = new Date(Date.now() + delay);
|
|
151
151
|
await this.datastore.retry(task.id, retryAt);
|
|
152
|
-
this.emit(
|
|
152
|
+
this.emit(events_1.ProcessorEvents.TASK_RETRY_SCHEDULED, {
|
|
153
153
|
task,
|
|
154
154
|
error,
|
|
155
|
-
|
|
155
|
+
errorAt: failedAt,
|
|
156
|
+
retryScheduledAt: retryAt,
|
|
156
157
|
});
|
|
157
158
|
}
|
|
158
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-processor.js","sourceRoot":"","sources":["../../src/processors/simple-processor.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,mDAAkD;AAKlD,0DAA4D;
|
|
1
|
+
{"version":3,"file":"simple-processor.js","sourceRoot":"","sources":["../../src/processors/simple-processor.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,mDAAkD;AAKlD,0DAA4D;AAC5D,qCAAoE;AAGpE,MAAM,cAAc,GAA0B;IAC5C,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,EAAE;IACnB,mBAAmB,EAAE,MAAM;IAC3B,cAAc,EAAE,KAAK;IACrB,oBAAoB,EAAE,KAAK;IAC3B,qBAAqB,EAAE,EAAE;IACzB,0BAA0B,EAAE,MAAM;CACnC,CAAC;AAYF,MAAM,uBAAuB,GAAG,EAAE,mBAAmB,EAAE,mBAAmB,EAAW,CAAC;AAOtF,MAAa,eAKX,SAAQ,0BAAuD;IASrD;IACA;IACA;IACA;IATF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CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,wBAAe,CAAC,WAAW,EAAE;gBACrC,IAAI;gBACJ,KAAK;gBACL,QAAQ;aACT,CAAC,CAAC;YAEH,OAAO;QACT,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QACtE,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC;QAE7C,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC7C,IAAI,CAAC,IAAI,CAAC,wBAAe,CAAC,oBAAoB,EAAE;YAC9C,IAAI;YACJ,KAAK;YACL,OAAO,EAAE,QAAQ;YACjB,gBAAgB,EAAE,OAAO;SAC1B,CAAC,CAAC;IACL,CAAC;CACF;AA/KD,0CA+KC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neofinancial/chrono",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Core package for Chrono task scheduling system",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"main": "build/index.js",
|
|
15
15
|
"types": "build/index.d.ts",
|
|
16
16
|
"files": [
|
|
17
|
-
"build/**"
|
|
17
|
+
"build/**",
|
|
18
|
+
"README.md"
|
|
18
19
|
],
|
|
19
20
|
"keywords": [],
|
|
20
21
|
"author": "Neo Financial Engineering <engineering@neofinancial.com>",
|