@powerhousedao/reactor 2.5.0-dev.33
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/LICENSE +661 -0
- package/dist/bench/end-to-end-flow.bench.d.ts +2 -0
- package/dist/bench/end-to-end-flow.bench.d.ts.map +1 -0
- package/dist/bench/end-to-end-flow.bench.js +256 -0
- package/dist/bench/end-to-end-flow.bench.js.map +1 -0
- package/dist/bench/event-bus.bench.d.ts +2 -0
- package/dist/bench/event-bus.bench.d.ts.map +1 -0
- package/dist/bench/event-bus.bench.js +238 -0
- package/dist/bench/event-bus.bench.js.map +1 -0
- package/dist/bench/queue-only.bench.d.ts +2 -0
- package/dist/bench/queue-only.bench.d.ts.map +1 -0
- package/dist/bench/queue-only.bench.js +40 -0
- package/dist/bench/queue-only.bench.js.map +1 -0
- package/dist/bench/reactor-throughput.bench.d.ts +2 -0
- package/dist/bench/reactor-throughput.bench.d.ts.map +1 -0
- package/dist/bench/reactor-throughput.bench.js +137 -0
- package/dist/bench/reactor-throughput.bench.js.map +1 -0
- package/dist/src/events/event-bus.d.ts +8 -0
- package/dist/src/events/event-bus.d.ts.map +1 -0
- package/dist/src/events/event-bus.js +53 -0
- package/dist/src/events/event-bus.js.map +1 -0
- package/dist/src/events/interfaces.d.ts +27 -0
- package/dist/src/events/interfaces.d.ts.map +1 -0
- package/dist/src/events/interfaces.js +2 -0
- package/dist/src/events/interfaces.js.map +1 -0
- package/dist/src/events/types.d.ts +24 -0
- package/dist/src/events/types.d.ts.map +1 -0
- package/dist/src/events/types.js +20 -0
- package/dist/src/events/types.js.map +1 -0
- package/dist/src/executor/interfaces.d.ts +72 -0
- package/dist/src/executor/interfaces.d.ts.map +1 -0
- package/dist/src/executor/interfaces.js +2 -0
- package/dist/src/executor/interfaces.js.map +1 -0
- package/dist/src/executor/job-executor.d.ts +62 -0
- package/dist/src/executor/job-executor.d.ts.map +1 -0
- package/dist/src/executor/job-executor.js +325 -0
- package/dist/src/executor/job-executor.js.map +1 -0
- package/dist/src/executor/types.d.ts +67 -0
- package/dist/src/executor/types.d.ts.map +1 -0
- package/dist/src/executor/types.js +11 -0
- package/dist/src/executor/types.js.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +8 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/queue/interfaces.d.ts +62 -0
- package/dist/src/queue/interfaces.d.ts.map +1 -0
- package/dist/src/queue/interfaces.js +2 -0
- package/dist/src/queue/interfaces.js.map +1 -0
- package/dist/src/queue/queue.d.ts +30 -0
- package/dist/src/queue/queue.d.ts.map +1 -0
- package/dist/src/queue/queue.js +136 -0
- package/dist/src/queue/queue.js.map +1 -0
- package/dist/src/queue/types.d.ts +38 -0
- package/dist/src/queue/types.d.ts.map +1 -0
- package/dist/src/queue/types.js +7 -0
- package/dist/src/queue/types.js.map +1 -0
- package/dist/src/shared/types.d.ts +23 -0
- package/dist/src/shared/types.d.ts.map +1 -0
- package/dist/src/shared/types.js +2 -0
- package/dist/src/shared/types.js.map +1 -0
- package/dist/test/event-bus.test.d.ts +2 -0
- package/dist/test/event-bus.test.d.ts.map +1 -0
- package/dist/test/event-bus.test.js +532 -0
- package/dist/test/event-bus.test.js.map +1 -0
- package/dist/test/job-executor.test.d.ts +2 -0
- package/dist/test/job-executor.test.d.ts.map +1 -0
- package/dist/test/job-executor.test.js +581 -0
- package/dist/test/job-executor.test.js.map +1 -0
- package/dist/test/queue.test.d.ts +2 -0
- package/dist/test/queue.test.d.ts.map +1 -0
- package/dist/test/queue.test.js +396 -0
- package/dist/test/queue.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { QueueEventTypes } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* In-memory implementation of the IQueue interface.
|
|
4
|
+
* Organizes jobs by documentId, scope, and branch to ensure proper ordering.
|
|
5
|
+
*/
|
|
6
|
+
export class InMemoryQueue {
|
|
7
|
+
eventBus;
|
|
8
|
+
queues = new Map();
|
|
9
|
+
jobIndex = new Map(); // jobId -> queueKey mapping
|
|
10
|
+
constructor(eventBus) {
|
|
11
|
+
this.eventBus = eventBus;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates a unique key for a document/scope/branch combination
|
|
15
|
+
*/
|
|
16
|
+
createQueueKey(documentId, scope, branch) {
|
|
17
|
+
return `${documentId}:${scope}:${branch}`;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Gets or creates a queue for the given key
|
|
21
|
+
*/
|
|
22
|
+
getQueue(queueKey) {
|
|
23
|
+
let queue = this.queues.get(queueKey);
|
|
24
|
+
if (!queue) {
|
|
25
|
+
queue = [];
|
|
26
|
+
this.queues.set(queueKey, queue);
|
|
27
|
+
}
|
|
28
|
+
return queue;
|
|
29
|
+
}
|
|
30
|
+
async enqueue(job) {
|
|
31
|
+
const queueKey = this.createQueueKey(job.documentId, job.scope, job.branch);
|
|
32
|
+
const queue = this.getQueue(queueKey);
|
|
33
|
+
// Add job to the end of the queue (FIFO)
|
|
34
|
+
queue.push(job);
|
|
35
|
+
// Track job location for removal
|
|
36
|
+
this.jobIndex.set(job.id, queueKey);
|
|
37
|
+
// Emit job available event
|
|
38
|
+
const eventData = {
|
|
39
|
+
documentId: job.documentId,
|
|
40
|
+
scope: job.scope,
|
|
41
|
+
branch: job.branch,
|
|
42
|
+
jobId: job.id,
|
|
43
|
+
};
|
|
44
|
+
await this.eventBus.emit(QueueEventTypes.JOB_AVAILABLE, eventData);
|
|
45
|
+
}
|
|
46
|
+
async dequeue(documentId, scope, branch) {
|
|
47
|
+
const queueKey = this.createQueueKey(documentId, scope, branch);
|
|
48
|
+
const queue = this.queues.get(queueKey);
|
|
49
|
+
if (!queue || queue.length === 0) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
// Remove job from the front of the queue (FIFO)
|
|
53
|
+
const job = queue.shift();
|
|
54
|
+
// Remove from job index
|
|
55
|
+
this.jobIndex.delete(job.id);
|
|
56
|
+
// Clean up empty queue
|
|
57
|
+
if (queue.length === 0) {
|
|
58
|
+
this.queues.delete(queueKey);
|
|
59
|
+
}
|
|
60
|
+
return job;
|
|
61
|
+
}
|
|
62
|
+
async dequeueNext() {
|
|
63
|
+
// Find the first non-empty queue and dequeue from it
|
|
64
|
+
for (const [queueKey, queue] of this.queues.entries()) {
|
|
65
|
+
if (queue.length > 0) {
|
|
66
|
+
const job = queue.shift();
|
|
67
|
+
// Remove from job index
|
|
68
|
+
this.jobIndex.delete(job.id);
|
|
69
|
+
// Clean up empty queue
|
|
70
|
+
if (queue.length === 0) {
|
|
71
|
+
this.queues.delete(queueKey);
|
|
72
|
+
}
|
|
73
|
+
return job;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
async size(documentId, scope, branch) {
|
|
79
|
+
const queueKey = this.createQueueKey(documentId, scope, branch);
|
|
80
|
+
const queue = this.queues.get(queueKey);
|
|
81
|
+
return queue ? queue.length : 0;
|
|
82
|
+
}
|
|
83
|
+
async totalSize() {
|
|
84
|
+
let total = 0;
|
|
85
|
+
for (const queue of this.queues.values()) {
|
|
86
|
+
total += queue.length;
|
|
87
|
+
}
|
|
88
|
+
return total;
|
|
89
|
+
}
|
|
90
|
+
async remove(jobId) {
|
|
91
|
+
const queueKey = this.jobIndex.get(jobId);
|
|
92
|
+
if (!queueKey) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
const queue = this.queues.get(queueKey);
|
|
96
|
+
if (!queue) {
|
|
97
|
+
// Clean up orphaned index entry
|
|
98
|
+
this.jobIndex.delete(jobId);
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
const jobIndex = queue.findIndex((job) => job.id === jobId);
|
|
102
|
+
if (jobIndex === -1) {
|
|
103
|
+
// Clean up orphaned index entry
|
|
104
|
+
this.jobIndex.delete(jobId);
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
// Remove job from queue
|
|
108
|
+
queue.splice(jobIndex, 1);
|
|
109
|
+
// Remove from job index
|
|
110
|
+
this.jobIndex.delete(jobId);
|
|
111
|
+
// Clean up empty queue
|
|
112
|
+
if (queue.length === 0) {
|
|
113
|
+
this.queues.delete(queueKey);
|
|
114
|
+
}
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
async clear(documentId, scope, branch) {
|
|
118
|
+
const queueKey = this.createQueueKey(documentId, scope, branch);
|
|
119
|
+
const queue = this.queues.get(queueKey);
|
|
120
|
+
if (queue) {
|
|
121
|
+
// Remove all jobs from the job index
|
|
122
|
+
for (const job of queue) {
|
|
123
|
+
this.jobIndex.delete(job.id);
|
|
124
|
+
}
|
|
125
|
+
// Remove the queue
|
|
126
|
+
this.queues.delete(queueKey);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async clearAll() {
|
|
130
|
+
// Clear all job indices
|
|
131
|
+
this.jobIndex.clear();
|
|
132
|
+
// Clear all queues
|
|
133
|
+
this.queues.clear();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../../src/queue/queue.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE;;;GAGG;AACH,MAAM,OAAO,aAAa;IAIJ;IAHZ,MAAM,GAAG,IAAI,GAAG,EAAiB,CAAC;IAClC,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC,CAAC,4BAA4B;IAE1E,YAAoB,QAAmB;QAAnB,aAAQ,GAAR,QAAQ,CAAW;IAAG,CAAC;IAE3C;;OAEG;IACK,cAAc,CACpB,UAAkB,EAClB,KAAa,EACb,MAAc;QAEd,OAAO,GAAG,UAAU,IAAI,KAAK,I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AI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC/B,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,KAAK,CACT,UAAkB,EAClB,KAAa,EACb,MAAc;QAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAChE,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAExC,IAAI,KAAK,EAAE,CAAC;YACV,qCAAqC;YACrC,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;gBACxB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/B,CAAC;YAED,mBAAmB;YACnB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,wBAAwB;QACxB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAEtB,mBAAmB;QACnB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Operation } from "#shared/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a job to be executed by the job executor
|
|
4
|
+
*/
|
|
5
|
+
export type Job = {
|
|
6
|
+
/** Unique identifier for the job */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The document ID this job operates on */
|
|
9
|
+
documentId: string;
|
|
10
|
+
/** The scope of the operation */
|
|
11
|
+
scope: string;
|
|
12
|
+
/** The branch of the operation */
|
|
13
|
+
branch: string;
|
|
14
|
+
/** The operation to be executed */
|
|
15
|
+
operation: Operation;
|
|
16
|
+
/** Timestamp when the job was created */
|
|
17
|
+
createdAt: string;
|
|
18
|
+
/** Number of retry attempts */
|
|
19
|
+
retryCount?: number;
|
|
20
|
+
/** Maximum number of retries allowed */
|
|
21
|
+
maxRetries?: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Event types for the queue system
|
|
25
|
+
*/
|
|
26
|
+
export declare const QueueEventTypes: {
|
|
27
|
+
readonly JOB_AVAILABLE: 10000;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Event data for job available events
|
|
31
|
+
*/
|
|
32
|
+
export type JobAvailableEvent = {
|
|
33
|
+
documentId: string;
|
|
34
|
+
scope: string;
|
|
35
|
+
branch: string;
|
|
36
|
+
jobId: string;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/queue/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG;IAChB,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;IAEX,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IAEnB,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IAEd,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IAEf,mCAAmC;IACnC,SAAS,EAAE,SAAS,CAAC;IAErB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAElB,+BAA+B;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;CAElB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/queue/types.ts"],"names":[],"mappings":"AA+BA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,aAAa,EAAE,KAAK;CACZ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basic Operation type for the queue
|
|
3
|
+
* This is a simplified version that includes the essential fields needed for queuing
|
|
4
|
+
*/
|
|
5
|
+
export type Operation = {
|
|
6
|
+
/** Position of the operation in the history */
|
|
7
|
+
index: number;
|
|
8
|
+
/** Timestamp of when the operation was added */
|
|
9
|
+
timestamp: string;
|
|
10
|
+
/** Hash of the resulting document data after the operation */
|
|
11
|
+
hash: string;
|
|
12
|
+
/** The number of operations skipped with this Operation */
|
|
13
|
+
skip: number;
|
|
14
|
+
/** The type/name of the operation */
|
|
15
|
+
type: string;
|
|
16
|
+
/** The input data for the operation */
|
|
17
|
+
input: any;
|
|
18
|
+
/** Error message for a failed action */
|
|
19
|
+
error?: string;
|
|
20
|
+
/** Unique operation id */
|
|
21
|
+
id?: string;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,KAAK,EAAE,GAAG,CAAC;IACX,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-bus.test.d.ts","sourceRoot":"","sources":["../../test/event-bus.test.ts"],"names":[],"mappings":""}
|