atomic-queues 2.2.0 → 2.3.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.
Files changed (54) hide show
  1. package/README.md +13 -49
  2. package/dist/decorators/constants.d.ts +0 -3
  3. package/dist/decorators/constants.d.ts.map +1 -1
  4. package/dist/decorators/constants.js +1 -5
  5. package/dist/decorators/constants.js.map +1 -1
  6. package/dist/decorators/index.d.ts +0 -1
  7. package/dist/decorators/index.d.ts.map +1 -1
  8. package/dist/decorators/index.js +0 -1
  9. package/dist/decorators/index.js.map +1 -1
  10. package/dist/decorators/interfaces.d.ts +0 -18
  11. package/dist/decorators/interfaces.d.ts.map +1 -1
  12. package/dist/decorators/metadata-readers.d.ts +1 -3
  13. package/dist/decorators/metadata-readers.d.ts.map +1 -1
  14. package/dist/decorators/metadata-readers.js +0 -8
  15. package/dist/decorators/metadata-readers.js.map +1 -1
  16. package/dist/domain/interfaces/config.interfaces.d.ts +0 -6
  17. package/dist/domain/interfaces/config.interfaces.d.ts.map +1 -1
  18. package/dist/module/atomic-queues.module.js +1 -1
  19. package/dist/module/atomic-queues.module.js.map +1 -1
  20. package/dist/services/entity-type-registry/entity-type-registry.service.d.ts +13 -0
  21. package/dist/services/entity-type-registry/entity-type-registry.service.d.ts.map +1 -0
  22. package/dist/services/entity-type-registry/entity-type-registry.service.js +75 -0
  23. package/dist/services/entity-type-registry/entity-type-registry.service.js.map +1 -0
  24. package/dist/services/entity-type-registry/index.d.ts +2 -0
  25. package/dist/services/entity-type-registry/index.d.ts.map +1 -0
  26. package/dist/services/{actor-registry → entity-type-registry}/index.js +1 -1
  27. package/dist/services/entity-type-registry/index.js.map +1 -0
  28. package/dist/services/executor-pool/executor-pool.service.d.ts +3 -3
  29. package/dist/services/executor-pool/executor-pool.service.d.ts.map +1 -1
  30. package/dist/services/executor-pool/executor-pool.service.js +5 -19
  31. package/dist/services/executor-pool/executor-pool.service.js.map +1 -1
  32. package/dist/services/handler-executor/handler-executor.service.d.ts +0 -2
  33. package/dist/services/handler-executor/handler-executor.service.d.ts.map +1 -1
  34. package/dist/services/handler-executor/handler-executor.service.js +0 -19
  35. package/dist/services/handler-executor/handler-executor.service.js.map +1 -1
  36. package/dist/services/index.d.ts +1 -1
  37. package/dist/services/index.d.ts.map +1 -1
  38. package/dist/services/index.js +1 -1
  39. package/dist/services/index.js.map +1 -1
  40. package/dist/services/registry/registry.service.d.ts.map +1 -1
  41. package/dist/services/registry/registry.service.js +3 -38
  42. package/dist/services/registry/registry.service.js.map +1 -1
  43. package/package.json +2 -2
  44. package/dist/decorators/actor.decorators.d.ts +0 -4
  45. package/dist/decorators/actor.decorators.d.ts.map +0 -1
  46. package/dist/decorators/actor.decorators.js +0 -32
  47. package/dist/decorators/actor.decorators.js.map +0 -1
  48. package/dist/services/actor-registry/actor-registry.service.d.ts +0 -32
  49. package/dist/services/actor-registry/actor-registry.service.d.ts.map +0 -1
  50. package/dist/services/actor-registry/actor-registry.service.js +0 -220
  51. package/dist/services/actor-registry/actor-registry.service.js.map +0 -1
  52. package/dist/services/actor-registry/index.d.ts +0 -2
  53. package/dist/services/actor-registry/index.d.ts.map +0 -1
  54. package/dist/services/actor-registry/index.js.map +0 -1
package/README.md CHANGED
@@ -34,9 +34,9 @@
34
34
 
35
35
  ## What is atomic-queues?
36
36
 
37
- **A distributed virtual actor runtime for Node.js, built entirely on Redis primitives.**
37
+ **Per-entity sequential processing for Node.js, built entirely on Redis primitives.**
38
38
 
39
- Think Orleans or Akka but for the NestJS ecosystem, requiring nothing beyond a Redis instance you probably already have.
39
+ Think of it as automatic entity-level serialization for the NestJS ecosystem, requiring nothing beyond a Redis instance you probably already have.
40
40
 
41
41
  Messages addressed to the same entity execute sequentially. Messages addressed to different entities execute in parallel. No distributed locks. No worker processes. No message broker. No BullMQ.
42
42
 
@@ -67,7 +67,7 @@ The standard answers — `SELECT ... FOR UPDATE`, optimistic locking with retrie
67
67
 
68
68
  The problem disappears if you change *when* serialization happens. Instead of serializing at the database level (row locks, transaction isolation), serialize at the **message level**: route all operations for a given entity through a single ordered log, and process that log sequentially. Different entities maintain independent logs with zero coordination between them.
69
69
 
70
- This is the virtual actor model. It's not new Erlang/OTP has used it since the 1980s, Orleans shipped it in 2014, Akka has been doing it on the JVM for over a decade. What *is* new is implementing it with nothing beyond Redis and making it native to the NestJS ecosystem.
70
+ This is the per-entity serialization model. It's the same insight behind the actor model (Erlang/OTP, Orleans, Akka) but implemented with nothing beyond Redis and native to the NestJS ecosystem. Entity types are defined implicitly: any CQRS command or query decorated with `@EntityType` automatically gets per-entity sequential processing. Your `@CommandHandler` and `@QueryHandler` classes are the handlers — no separate actor classes needed.
71
71
 
72
72
  ```
73
73
  ┌─────────────────────────────────────────────────┐
@@ -106,31 +106,7 @@ That's the entire contract. `@EntityType` says "this message targets the `accoun
106
106
 
107
107
  ### Two levels of abstraction
108
108
 
109
- atomic-queues gives you two ways to handle messages, and they're not different systems they're two levels of abstraction over the same dispatch engine.
110
-
111
- **Actors** are the foundational primitive. An actor class *is* an entity — its fields are the state, its methods are message handlers. The runtime manages its lifecycle: activate on first message, evict from memory on idle, persist state to Redis automatically, restore on reactivation. The entity type is inferred from the message classes' `@EntityType` decorator — no `@Actor` decorator required.
112
-
113
- ```typescript
114
- @Injectable()
115
- export class AccountActor {
116
- private balance = 0;
117
-
118
- @On(DepositCommand) // DepositCommand has @EntityType('account')
119
- async deposit(msg: DepositCommand) {
120
- this.balance += msg.amount;
121
- return this.balance;
122
- }
123
-
124
- @On(WithdrawCommand) // WithdrawCommand has @EntityType('account')
125
- async withdraw(msg: WithdrawCommand) {
126
- if (this.balance < msg.amount) throw new InsufficientFunds();
127
- this.balance -= msg.amount;
128
- return this.balance;
129
- }
130
- }
131
- ```
132
-
133
- **CQRS handlers** are the convenience layer for teams using `@nestjs/cqrs`. You don't write actor classes — you write standard `@CommandHandler` and `@QueryHandler` classes exactly as NestJS CQRS prescribes, and atomic-queues intercepts the dispatch to route them through the same per-entity log and gate system. The handler code doesn't change. The guarantee changes — instead of executing inline on whatever request thread happens to call `commandBus.execute()`, your handler now executes sequentially per entity, cluster-wide.
109
+ Entity types are defined implicitly — decorate your CQRS command or query class with `@EntityType`, and atomic-queues routes it through the per-entity log and gate system. Your `@CommandHandler` and `@QueryHandler` classes are the handlers. The handler code doesn't change. The guarantee changes — instead of executing inline on whatever request thread happens to call `commandBus.execute()`, your handler now executes sequentially per entity, cluster-wide.
134
110
 
135
111
  ```typescript
136
112
  @EntityType('account')
@@ -150,7 +126,7 @@ export class WithdrawHandler implements ICommandHandler<WithdrawCommand> {
150
126
  }
151
127
  ```
152
128
 
153
- The library auto-discovers `@CommandHandler` and `@QueryHandler` classes at boot and wires them into the dispatch pipeline. Your existing CQRS architecture gets per-entity sequential guarantees without changing a single handler. The CQRS surface *calls into the actor runtime* — it's not a separate execution path.
129
+ The library auto-discovers `@CommandHandler` and `@QueryHandler` classes at boot and wires them into the dispatch pipeline. Your existing CQRS architecture gets per-entity sequential guarantees without changing a single handler.
154
130
 
155
131
  ### Enqueuing messages
156
132
 
@@ -171,10 +147,6 @@ const stock = await queueBus.enqueueAndWait('warehouse', 'GetStockQuery', 'SKU-0
171
147
  // Scoped cross-service
172
148
  const warehouse = queueBus.forEntity('warehouse');
173
149
  await warehouse.enqueue('ReserveStockCommand', 'SKU-001', { sku: 'SKU-001', quantity: 50 });
174
-
175
- // Actor-style direct send
176
- await actorSystem.send('account', accountId, new DepositCommand(100));
177
- const balance = await actorSystem.sendAndWait('account', accountId, new GetBalanceQuery());
178
150
  ```
179
151
 
180
152
  ---
@@ -249,7 +221,7 @@ const stock = await queueBus.enqueueAndWait(new GetStockQuery({ sku: 'SKU-001' }
249
221
  stock.available; // fully typed — no string API, no explicit timeout, no code dependency on warehouse-service
250
222
  ```
251
223
 
252
- When `warehouse-service` starts, it scans its own `@Actor`, `@CommandHandler`, and `@QueryHandler` classes and publishes **entity contracts** to Redis — a JSON document listing the entity type, accepted messages, optional JSON schemas, and reply schemas, refreshed via heartbeat TTL. When `order-service` enqueues a message, the registry validates it at the call site *before* it enters the log: entity type exists, message name is accepted, payload matches schema. Errors are immediate and descriptive — not silent dead letters discovered hours later in a DLQ dashboard.
224
+ When `warehouse-service` starts, it scans its own `@CommandHandler` and `@QueryHandler` classes and publishes **entity contracts** to Redis — a JSON document listing the entity type, accepted messages, optional JSON schemas, and reply schemas, refreshed via heartbeat TTL. When `order-service` enqueues a message, the registry validates it at the call site *before* it enters the log: entity type exists, message name is accepted, payload matches schema. Errors are immediate and descriptive — not silent dead letters discovered hours later in a DLQ dashboard.
253
225
 
254
226
  The Lua scheduler ensures each node only dispatches messages for entity types it owns handlers for. Services that don't own any handlers (API gateways, pure producers) participate in the registry without stealing messages from handler-owning nodes.
255
227
 
@@ -421,16 +393,16 @@ SADD aq:ready account:a-1
421
393
  PUBLISH aq:tickle 1
422
394
  ```
423
395
 
424
- **Any language with a Redis client is a first-class citizen.** A Python data pipeline can enqueue commands to a NestJS-hosted actor. A Go microservice can fire events at entities defined in TypeScript. A Rust executor can run the same Lua scheduling script and compete for gates on equal terms with the Node.js executor pool. A Bash script can trigger a workflow.
396
+ **Any language with a Redis client is a first-class citizen.** A Python data pipeline can enqueue commands to a NestJS-hosted entity. A Go microservice can fire events at entities defined in TypeScript. A Rust executor can run the same Lua scheduling script and compete for gates on equal terms with the Node.js executor pool. A Bash script can trigger a workflow.
425
397
 
426
- This is not a feature of any existing mainstream actor framework. Orleans requires the Orleans silo. Akka requires the JVM. Temporal requires the Temporal server with its own database. All of them are monoglot execution environments — actors must be written in the framework's language.
398
+ This is not a feature of most frameworks. Orleans requires the Orleans silo. Temporal requires the Temporal server with its own database. All of them are monoglot execution environments — handlers must be written in the framework's language.
427
399
 
428
400
  atomic-queues is **polyglot by construction**. The coordination happens in Redis, not in the runtime. Any process that speaks the wire protocol participates on equal terms, and the [WIRE-PROTOCOL.md](./WIRE-PROTOCOL.md) includes a complete Python reference client to prove it.
429
401
 
430
402
  This opens architectures that are genuinely difficult to build otherwise:
431
403
 
432
404
  - **Ingest in Go, process in Node.js, analyze in Python.** Each layer speaks Redis. The entity logs are the integration boundary.
433
- - **Rust executors for CPU-hot-path actors.** The same Lua scheduler, the same gates, the same entity logs. The Rust process is just another executor that happens to be faster. The Node.js side doesn't know or care.
405
+ - **Rust executors for CPU-hot-path entities.** The same Lua scheduler, the same gates, the same entity logs. The Rust process is just another executor that happens to be faster. The Node.js side doesn't know or care.
434
406
  - **Gradual migration.** Move one entity type's handlers to a different service, a different language, or a different infrastructure — without touching any other service's code. The entity contract in the registry is the interface, not the import statement.
435
407
  - **Edge coordination.** An IoT device with a Redis client and 3 commands of knowledge can participate in the same entity model as your cloud services.
436
408
 
@@ -494,8 +466,6 @@ AtomicQueuesModule.forRoot({
494
466
  defaultEntityId: 'accountId',
495
467
  gateTTL: 60,
496
468
  retry: { maxAttempts: 5, backoff: 'exponential', backoffDelay: 2000 },
497
- actorIdleTimeout: 120000,
498
- statePersistence: true,
499
469
  replyTimeout: 5000, // per-entity enqueueAndWait timeout (ms)
500
470
  },
501
471
  },
@@ -544,7 +514,7 @@ npm install zod zod-to-json-schema # for schema validation in the registry
544
514
  |---|---|---|---|
545
515
  | Per-entity ordering | Manual (named queues) | Workflow-scoped | Built-in, zero config |
546
516
  | Cross-entity parallelism | Worker pools | Worker pools | Shared executor pool |
547
- | Stateful entities | No | Workflow state | Virtual actors |
517
+ | Stateful entities | No | Workflow state | Per-entity sequential handlers |
548
518
  | Cross-service messaging | Shared queue names | gRPC | Redis registry + codegen |
549
519
  | Polyglot clients | JS/TS only | SDK per language | Any Redis client (3 commands) |
550
520
  | Infrastructure required | Redis | Temporal server + DB | Redis only |
@@ -561,8 +531,6 @@ npm install zod zod-to-json-schema # for schema validation in the registry
561
531
  | `@EntityType('type')` | Route a message to an entity type |
562
532
  | `@QueueEntityId()` | Mark the property holding the entity ID |
563
533
  | `@QueueEntity('type', 'prop')` | Combined entity type + ID |
564
- | `@Actor('type')` | Explicitly declare an actor (optional — entity type is inferred from `@On` handlers) |
565
- | `@On(MessageClass)` | Handle a message type on an actor |
566
534
  | `@Schema(zodSchema)` | Attach a Zod schema for registry validation |
567
535
  | `@ReplySchema(zodSchema)` | Attach a reply schema for query codegen |
568
536
 
@@ -572,7 +540,7 @@ npm install zod zod-to-json-schema # for schema validation in the registry
572
540
 
573
541
  ### Redis as a Single Point of Failure
574
542
 
575
- atomic-queues relies on a single Redis instance for all coordination: message logs, gates, the ready set, actor state, and the distributed registry. If that Redis instance becomes unavailable, all dispatch stops.
543
+ atomic-queues relies on a single Redis instance for all coordination: message logs, gates, the ready set, and the distributed registry. If that Redis instance becomes unavailable, all dispatch stops.
576
544
 
577
545
  **Mitigations:**
578
546
 
@@ -585,10 +553,6 @@ atomic-queues relies on a single Redis instance for all coordination: message lo
585
553
 
586
554
  Failed messages are re-enqueued with `RPUSH`, placing them at the back of the entity's log. This means other pending messages for the same entity are processed before the retry. If you need head-of-line retry (failed message retried immediately), implement a custom retry strategy.
587
555
 
588
- ### Actor State
589
-
590
- Actor state is serialized to Redis as JSON after each message. `Map`, `Set`, `Date`, and circular references are silently skipped during serialization. Keep actor state plain and serializable. State TTL defaults to 86400 seconds (24 hours) and is configurable per entity type via `stateTTL` in the module config.
591
-
592
556
  ---
593
557
 
594
558
  ## Migrating from V1
@@ -599,9 +563,9 @@ V2 is a full rewrite of the internals. BullMQ is removed. Workers are removed. T
599
563
 
600
564
  **What's removed**: `@WorkerProcessor`, `@JobHandler`, `@EntityScaler`, `@OnSpawnWorker`, `@OnTerminateWorker`, `@GetActiveEntities`, `@GetDesiredWorkerCount`, `.forProcessor()`. All worker and scaling concepts are gone.
601
565
 
602
- **What's new**: `@Actor`, `@On`, `@Schema`, `@ReplySchema`, `ActorSystem`, `RegistryService`, distributed registry, runtime introspection (`queueBus.introspect()`), cross-service string-based API, `Reply<T>` phantom type, class codegen CLI (`--classes`), config-driven timeouts.
566
+ **What's new**: `@Schema`, `@ReplySchema`, `ActorSystem`, `RegistryService`, distributed registry, runtime introspection (`queueBus.introspect()`), cross-service string-based API, `Reply<T>` phantom type, class codegen CLI (`--classes`), config-driven timeouts.
603
567
 
604
- **Migration steps**: (1) remove all `@WorkerProcessor` classes — replace with `@Actor` or configure entity defaults in module config; (2) remove all scaling decorators; (3) run the data migration script to drain in-flight BullMQ jobs to the new log format; (4) remove `bullmq` and `@nestjs/bullmq` from your dependencies.
568
+ **Migration steps**: (1) remove all `@WorkerProcessor` classes — configure entity defaults in module config and use `@CommandHandler`/`@QueryHandler`; (2) remove all scaling decorators; (3) run the data migration script to drain in-flight BullMQ jobs to the new log format; (4) remove `bullmq` and `@nestjs/bullmq` from your dependencies.
605
569
 
606
570
  ---
607
571
 
@@ -2,9 +2,6 @@ export declare const ENTITY_TYPE_METADATA = "atomic:entity-type";
2
2
  export declare const ENTITY_ID_METADATA = "atomic:entity-id";
3
3
  export declare const JOB_COMMAND_METADATA = "atomic:job-command";
4
4
  export declare const JOB_QUERY_METADATA = "atomic:job-query";
5
- export declare const ACTOR_METADATA = "atomic:actor";
6
- export declare const ACTOR_HANDLER_METADATA = "atomic:actor-handler";
7
- export declare const ACTOR_HANDLERS_METADATA = "atomic:actor-handlers";
8
5
  export declare const SCHEMA_METADATA = "atomic:schema";
9
6
  export declare const REPLY_SCHEMA_METADATA = "atomic:reply-schema";
10
7
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/decorators/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AACzD,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAGrD,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AACzD,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAGrD,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAC7C,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAC7D,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AAG/D,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAC/C,eAAO,MAAM,qBAAqB,wBAAwB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/decorators/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AACzD,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAGrD,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AACzD,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAGrD,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAC/C,eAAO,MAAM,qBAAqB,wBAAwB,CAAC"}
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REPLY_SCHEMA_METADATA = exports.SCHEMA_METADATA = exports.ACTOR_HANDLERS_METADATA = exports.ACTOR_HANDLER_METADATA = exports.ACTOR_METADATA = exports.JOB_QUERY_METADATA = exports.JOB_COMMAND_METADATA = exports.ENTITY_ID_METADATA = exports.ENTITY_TYPE_METADATA = void 0;
3
+ exports.REPLY_SCHEMA_METADATA = exports.SCHEMA_METADATA = exports.JOB_QUERY_METADATA = exports.JOB_COMMAND_METADATA = exports.ENTITY_ID_METADATA = exports.ENTITY_TYPE_METADATA = void 0;
4
4
  // Entity routing
5
5
  exports.ENTITY_TYPE_METADATA = 'atomic:entity-type';
6
6
  exports.ENTITY_ID_METADATA = 'atomic:entity-id';
7
7
  // CQRS job routing
8
8
  exports.JOB_COMMAND_METADATA = 'atomic:job-command';
9
9
  exports.JOB_QUERY_METADATA = 'atomic:job-query';
10
- // Actor
11
- exports.ACTOR_METADATA = 'atomic:actor';
12
- exports.ACTOR_HANDLER_METADATA = 'atomic:actor-handler';
13
- exports.ACTOR_HANDLERS_METADATA = 'atomic:actor-handlers';
14
10
  // Schema
15
11
  exports.SCHEMA_METADATA = 'atomic:schema';
16
12
  exports.REPLY_SCHEMA_METADATA = 'atomic:reply-schema';
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/decorators/constants.ts"],"names":[],"mappings":";;;AAAA,iBAAiB;AACJ,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAC5C,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AAErD,mBAAmB;AACN,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAC5C,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AAErD,QAAQ;AACK,QAAA,cAAc,GAAG,cAAc,CAAC;AAChC,QAAA,sBAAsB,GAAG,sBAAsB,CAAC;AAChD,QAAA,uBAAuB,GAAG,uBAAuB,CAAC;AAE/D,SAAS;AACI,QAAA,eAAe,GAAG,eAAe,CAAC;AAClC,QAAA,qBAAqB,GAAG,qBAAqB,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/decorators/constants.ts"],"names":[],"mappings":";;;AAAA,iBAAiB;AACJ,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAC5C,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AAErD,mBAAmB;AACN,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAC5C,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AAErD,SAAS;AACI,QAAA,eAAe,GAAG,eAAe,CAAC;AAClC,QAAA,qBAAqB,GAAG,qBAAqB,CAAC"}
@@ -2,7 +2,6 @@ export * from './constants';
2
2
  export * from './interfaces';
3
3
  export * from './entity.decorators';
4
4
  export * from './job.decorators';
5
- export * from './actor.decorators';
6
5
  export * from './schema.decorators';
7
6
  export * from './metadata-readers';
8
7
  export * from './registry';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -18,7 +18,6 @@ __exportStar(require("./constants"), exports);
18
18
  __exportStar(require("./interfaces"), exports);
19
19
  __exportStar(require("./entity.decorators"), exports);
20
20
  __exportStar(require("./job.decorators"), exports);
21
- __exportStar(require("./actor.decorators"), exports);
22
21
  __exportStar(require("./schema.decorators"), exports);
23
22
  __exportStar(require("./metadata-readers"), exports);
24
23
  __exportStar(require("./registry"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,+CAA6B;AAC7B,sDAAoC;AACpC,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,qDAAmC;AACnC,6CAA2B;AAC3B,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,+CAA6B;AAC7B,sDAAoC;AACpC,mDAAiC;AACjC,sDAAoC;AACpC,qDAAmC;AACnC,6CAA2B;AAC3B,0CAAwB"}
@@ -40,24 +40,6 @@ export interface JobQueryMetadata {
40
40
  targetClass: Function;
41
41
  paramNames: string[];
42
42
  }
43
- /**
44
- * Options for @Actor decorator
45
- */
46
- export interface ActorOptions {
47
- /** Entity type this actor handles */
48
- entityType: string;
49
- /** Default property name for entity ID extraction */
50
- defaultEntityId?: string;
51
- }
52
- /**
53
- * Stored actor handler metadata
54
- */
55
- export interface ActorHandlerMetadata {
56
- /** The message class this handler processes */
57
- messageClass: Function;
58
- /** The method name on the actor class */
59
- methodName: string;
60
- }
61
43
  /**
62
44
  * Options for @Schema decorator
63
45
  */
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/decorators/interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,WAAW,EAAE,QAAQ,CAAC;IACtB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,WAAW,EAAE,QAAQ,CAAC;IACtB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,UAAU,EAAE,MAAM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AAC;IACtB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,6CAA6C;IAC7C,MAAM,EAAE,GAAG,CAAC;IACZ,0CAA0C;IAC1C,WAAW,CAAC,EAAE,GAAG,CAAC;CACnB"}
@@ -1,10 +1,8 @@
1
- import { JobCommandMetadata, JobQueryMetadata, ActorOptions, ActorHandlerMetadata } from './interfaces';
1
+ import { JobCommandMetadata, JobQueryMetadata } from './interfaces';
2
2
  export declare function getEntityType(target: Function): string | undefined;
3
3
  export declare function getEntityIdProperty(target: Function): string | undefined;
4
4
  export declare function getJobCommandMetadata(target: Function): JobCommandMetadata | undefined;
5
5
  export declare function getJobQueryMetadata(target: Function): JobQueryMetadata | undefined;
6
- export declare function getActorMetadata(target: Function): ActorOptions | undefined;
7
- export declare function getActorHandlers(target: Function): ActorHandlerMetadata[];
8
6
  export declare function getSchemaMetadata(target: Function): any | undefined;
9
7
  export declare function getReplySchemaMetadata(target: Function): any | undefined;
10
8
  //# sourceMappingURL=metadata-readers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metadata-readers.d.ts","sourceRoot":"","sources":["../../src/decorators/metadata-readers.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAEtB,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAElE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAExE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,kBAAkB,GAAG,SAAS,CAEtF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,GAAG,gBAAgB,GAAG,SAAS,CAElF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAE3E;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,QAAQ,GAAG,oBAAoB,EAAE,CAEzE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,GAAG,GAAG,GAAG,SAAS,CAEnE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,QAAQ,GAAG,GAAG,GAAG,SAAS,CAExE"}
1
+ {"version":3,"file":"metadata-readers.d.ts","sourceRoot":"","sources":["../../src/decorators/metadata-readers.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEpE,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAElE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAExE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,kBAAkB,GAAG,SAAS,CAEtF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,GAAG,gBAAgB,GAAG,SAAS,CAElF;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,GAAG,GAAG,GAAG,SAAS,CAEnE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,QAAQ,GAAG,GAAG,GAAG,SAAS,CAExE"}
@@ -4,8 +4,6 @@ exports.getEntityType = getEntityType;
4
4
  exports.getEntityIdProperty = getEntityIdProperty;
5
5
  exports.getJobCommandMetadata = getJobCommandMetadata;
6
6
  exports.getJobQueryMetadata = getJobQueryMetadata;
7
- exports.getActorMetadata = getActorMetadata;
8
- exports.getActorHandlers = getActorHandlers;
9
7
  exports.getSchemaMetadata = getSchemaMetadata;
10
8
  exports.getReplySchemaMetadata = getReplySchemaMetadata;
11
9
  const constants_1 = require("./constants");
@@ -21,12 +19,6 @@ function getJobCommandMetadata(target) {
21
19
  function getJobQueryMetadata(target) {
22
20
  return Reflect.getMetadata(constants_1.JOB_QUERY_METADATA, target);
23
21
  }
24
- function getActorMetadata(target) {
25
- return Reflect.getMetadata(constants_1.ACTOR_METADATA, target);
26
- }
27
- function getActorHandlers(target) {
28
- return Reflect.getMetadata(constants_1.ACTOR_HANDLERS_METADATA, target) || [];
29
- }
30
22
  function getSchemaMetadata(target) {
31
23
  return Reflect.getMetadata(constants_1.SCHEMA_METADATA, target);
32
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"metadata-readers.js","sourceRoot":"","sources":["../../src/decorators/metadata-readers.ts"],"names":[],"mappings":";;AAiBA,sCAEC;AAED,kDAEC;AAED,sDAEC;AAED,kDAEC;AAED,4CAEC;AAED,4CAEC;AAED,8CAEC;AAED,wDAEC;AA/CD,2CASqB;AAQrB,SAAgB,aAAa,CAAC,MAAgB;IAC5C,OAAO,OAAO,CAAC,WAAW,CAAC,gCAAoB,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,mBAAmB,CAAC,MAAgB;IAClD,OAAO,OAAO,CAAC,WAAW,CAAC,8BAAkB,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,SAAgB,qBAAqB,CAAC,MAAgB;IACpD,OAAO,OAAO,CAAC,WAAW,CAAC,gCAAoB,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,mBAAmB,CAAC,MAAgB;IAClD,OAAO,OAAO,CAAC,WAAW,CAAC,8BAAkB,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,SAAgB,gBAAgB,CAAC,MAAgB;IAC/C,OAAO,OAAO,CAAC,WAAW,CAAC,0BAAc,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAED,SAAgB,gBAAgB,CAAC,MAAgB;IAC/C,OAAO,OAAO,CAAC,WAAW,CAAC,mCAAuB,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;AACpE,CAAC;AAED,SAAgB,iBAAiB,CAAC,MAAgB;IAChD,OAAO,OAAO,CAAC,WAAW,CAAC,2BAAe,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAED,SAAgB,sBAAsB,CAAC,MAAgB;IACrD,OAAO,OAAO,CAAC,WAAW,CAAC,iCAAqB,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC"}
1
+ {"version":3,"file":"metadata-readers.js","sourceRoot":"","sources":["../../src/decorators/metadata-readers.ts"],"names":[],"mappings":";;AAUA,sCAEC;AAED,kDAEC;AAED,sDAEC;AAED,kDAEC;AAED,8CAEC;AAED,wDAEC;AAhCD,2CAOqB;AAGrB,SAAgB,aAAa,CAAC,MAAgB;IAC5C,OAAO,OAAO,CAAC,WAAW,CAAC,gCAAoB,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,mBAAmB,CAAC,MAAgB;IAClD,OAAO,OAAO,CAAC,WAAW,CAAC,8BAAkB,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,SAAgB,qBAAqB,CAAC,MAAgB;IACpD,OAAO,OAAO,CAAC,WAAW,CAAC,gCAAoB,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,mBAAmB,CAAC,MAAgB;IAClD,OAAO,OAAO,CAAC,WAAW,CAAC,8BAAkB,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED,SAAgB,iBAAiB,CAAC,MAAgB;IAChD,OAAO,OAAO,CAAC,WAAW,CAAC,2BAAe,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AAED,SAAgB,sBAAsB,CAAC,MAAgB;IACrD,OAAO,OAAO,CAAC,WAAW,CAAC,iCAAqB,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC"}
@@ -32,12 +32,6 @@ export interface IEntityConfig {
32
32
  gateTTL?: number;
33
33
  /** Retry policy for this entity type */
34
34
  retry?: IRetryPolicy;
35
- /** Idle timeout in ms before actor state is evicted from memory (default: 60000) */
36
- actorIdleTimeout?: number;
37
- /** Persist actor state to Redis on eviction (default: true) */
38
- statePersistence?: boolean;
39
- /** TTL in seconds for persisted actor state in Redis (default: 86400) */
40
- stateTTL?: number;
41
35
  /** Default timeout in ms for enqueueAndWait on this entity type */
42
36
  replyTimeout?: number;
43
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.interfaces.d.ts","sourceRoot":"","sources":["../../../src/domain/interfaces/config.interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uBAAuB;IACvB,OAAO,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IAClC,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oFAAoF;IACpF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,qCAAqC;IACrC,KAAK,EAAE,YAAY,CAAC;IAEpB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAEzC,yDAAyD;IACzD,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,wEAAwE;IACxE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC"}
1
+ {"version":3,"file":"config.interfaces.d.ts","sourceRoot":"","sources":["../../../src/domain/interfaces/config.interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;I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CAAqC;IACrC,KAAK,EAAE,YAAY,CAAC;IAEpB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAEzC,yDAAyD;IACzD,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,wEAAwE;IACxE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC"}
@@ -21,7 +21,7 @@ const CORE_SERVICES = [
21
21
  services_1.SchedulerService,
22
22
  services_1.ExecutorPoolService,
23
23
  services_1.HandlerExecutor,
24
- services_1.ActorRegistry,
24
+ services_1.EntityTypeRegistry,
25
25
  services_1.ActorSystem,
26
26
  services_1.QueueBus,
27
27
  services_1.CommandDiscoveryService,
@@ -1 +1 @@
1
- {"version":3,"file":"atomic-queues.module.js","sourceRoot":"","sources":["../../src/module/atomic-queues.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA+E;AAC/E,uCAAkF;AAClF,sDAA4B;AAE5B,0CAeqB;AAErB,MAAM,aAAa,GAAe;IAChC,qBAAU;IACV,sBAAW;IACX,2BAAgB;IAChB,8BAAmB;IACnB,0BAAe;IACf,wBAAa;IACb,sBAAW;IACX,mBAAQ;IACR,kCAAuB;IACvB,0BAAe;IACf,0BAAe;IACf,0BAAe;CAChB,CAAC;AAaK,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAC7B,MAAM,CAAC,OAAO,CAAC,MAAiC;QAC9C,OAAO;YACL,MAAM,EAAE,oBAAkB;YAC1B,OAAO,EAAE,CAAC,sBAAe,CAAC;YAC1B,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,+BAAoB,EAAE,Q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AAC;QACD,OAAO,IAAI,iBAAK,CAAC;YACf,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,WAAW;YACtC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI;YAC/B,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ;YAC/B,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE;YACnB,oBAAoB,EAAE,MAAM,CAAC,KAAK,CAAC,oBAAoB,IAAI,IAAI;SAChE,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAzDY,gDAAkB;6BAAlB,kBAAkB;IAF9B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,kBAAkB,CAyD9B"}
1
+ {"version":3,"file":"atomic-queues.module.js","sourceRoot":"","sources":["../../src/module/atomic-queues.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA+E;AAC/E,uCAAkF;AAClF,sDAA4B;AAE5B,0CAeqB;AAErB,MAAM,aAAa,GAAe;IAChC,qBAAU;IACV,sBAAW;IACX,2BAAgB;IAChB,8BAAmB;IACnB,0BAAe;IACf,6BAAkB;IAClB,sBAAW;IACX,mBAAQ;IACR,kCAAuB;IACvB,0BAAe;IACf,0BAAe;IACf,0BAAe;CAChB,CAAC;AAaK,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAC7B,MAAM,CAAC,OAAO,CAAC,MAAiC;QAC9C,OAAO;YACL,MAAM,EAAE,oBAAkB;YAC1B,OAAO,EAAE,CAAC,sBAAe,CAAC;YAC1B,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,+BAAoB,EAAE,QAAQ,EAAE,MAAM,EAAE;gBACnD;oBACE,OAAO,EAAE,8BAAmB;oBAC5B,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC;iBACpD;gBACD,uBAAgB;gBAChB,sBAAe;gBACf,GAAG,aAAa;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AK,CAAC,QAAQ;YAC/B,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE;YACnB,oBAAoB,EAAE,MAAM,CAAC,KAAK,CAAC,oBAAoB,IAAI,IAAI;SAChE,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAzDY,gDAAkB;6BAAlB,kBAAkB;IAF9B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,kBAAkB,CAyD9B"}
@@ -0,0 +1,13 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import { DiscoveryService } from '@nestjs/core';
3
+ export declare class EntityTypeRegistry implements OnModuleInit {
4
+ private readonly discoveryService;
5
+ private readonly logger;
6
+ private readonly entityTypes;
7
+ constructor(discoveryService: DiscoveryService);
8
+ onModuleInit(): Promise<void>;
9
+ getRegisteredEntityTypes(): string[];
10
+ hasEntityType(entityType: string): boolean;
11
+ private discoverEntityTypes;
12
+ }
13
+ //# sourceMappingURL=entity-type-registry.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-type-registry.service.d.ts","sourceRoot":"","sources":["../../../src/services/entity-type-registry/entity-type-registry.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAY,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMhD,qBACa,kBAAmB,YAAW,YAAY;IAI7B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAHzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;gBAER,gBAAgB,EAAE,gBAAgB;IAErE,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAInC,wBAAwB,IAAI,MAAM,EAAE;IAIpC,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAI1C,OAAO,CAAC,mBAAmB;CAgC5B"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var EntityTypeRegistry_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.EntityTypeRegistry = void 0;
17
+ const common_1 = require("@nestjs/common");
18
+ const core_1 = require("@nestjs/core");
19
+ const decorators_1 = require("../../decorators");
20
+ const COMMAND_HANDLER_METADATA = '__commandHandler__';
21
+ const QUERY_HANDLER_METADATA = '__queryHandler__';
22
+ let EntityTypeRegistry = EntityTypeRegistry_1 = class EntityTypeRegistry {
23
+ constructor(discoveryService) {
24
+ this.discoveryService = discoveryService;
25
+ this.logger = new common_1.Logger(EntityTypeRegistry_1.name);
26
+ this.entityTypes = new Set();
27
+ }
28
+ async onModuleInit() {
29
+ this.discoverEntityTypes();
30
+ }
31
+ getRegisteredEntityTypes() {
32
+ return Array.from(this.entityTypes);
33
+ }
34
+ hasEntityType(entityType) {
35
+ return this.entityTypes.has(entityType);
36
+ }
37
+ discoverEntityTypes() {
38
+ if (!this.discoveryService)
39
+ return;
40
+ const providers = this.discoveryService.getProviders();
41
+ for (const wrapper of providers) {
42
+ const { metatype } = wrapper;
43
+ if (!metatype)
44
+ continue;
45
+ const commandClass = Reflect.getMetadata(COMMAND_HANDLER_METADATA, metatype);
46
+ if (commandClass && typeof commandClass === 'function') {
47
+ const et = (0, decorators_1.getEntityType)(commandClass);
48
+ if (et)
49
+ this.entityTypes.add(et);
50
+ }
51
+ const queryClass = Reflect.getMetadata(QUERY_HANDLER_METADATA, metatype);
52
+ if (queryClass && typeof queryClass === 'function') {
53
+ const et = (0, decorators_1.getEntityType)(queryClass);
54
+ if (et)
55
+ this.entityTypes.add(et);
56
+ }
57
+ const cmdMeta = (0, decorators_1.getJobCommandMetadata)(metatype);
58
+ if (cmdMeta?.entityType)
59
+ this.entityTypes.add(cmdMeta.entityType);
60
+ const queryMeta = (0, decorators_1.getJobQueryMetadata)(metatype);
61
+ if (queryMeta?.entityType)
62
+ this.entityTypes.add(queryMeta.entityType);
63
+ }
64
+ if (this.entityTypes.size > 0) {
65
+ this.logger.log(`Discovered entity types: [${Array.from(this.entityTypes).join(', ')}]`);
66
+ }
67
+ }
68
+ };
69
+ exports.EntityTypeRegistry = EntityTypeRegistry;
70
+ exports.EntityTypeRegistry = EntityTypeRegistry = EntityTypeRegistry_1 = __decorate([
71
+ (0, common_1.Injectable)(),
72
+ __param(0, (0, common_1.Optional)()),
73
+ __metadata("design:paramtypes", [core_1.DiscoveryService])
74
+ ], EntityTypeRegistry);
75
+ //# sourceMappingURL=entity-type-registry.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-type-registry.service.js","sourceRoot":"","sources":["../../../src/services/entity-type-registry/entity-type-registry.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA4E;AAC5E,uCAAgD;AAChD,iDAA6F;AAE7F,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AACtD,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAG3C,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAI7B,YAAwB,gBAAmD;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAH1D,WAAM,GAAG,IAAI,eAAM,CAAC,oBAAkB,CAAC,IAAI,CA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AAA,kCAAqB,EAAC,QAAQ,CAAC,CAAC;YAChD,IAAI,OAAO,EAAE,UAAU;gBAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAElE,MAAM,SAAS,GAAG,IAAA,gCAAmB,EAAC,QAAQ,CAAC,CAAC;YAChD,IAAI,SAAS,EAAE,UAAU;gBAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACxE,CAAC;QAED,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,6BAA6B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;CACF,CAAA;AAlDY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;IAKE,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCAAoC,uBAAgB;GAJhE,kBAAkB,CAkD9B"}
@@ -0,0 +1,2 @@
1
+ export * from './entity-type-registry.service';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/entity-type-registry/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./actor-registry.service"), exports);
17
+ __exportStar(require("./entity-type-registry.service"), exports);
18
18
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/entity-type-registry/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C"}
@@ -5,7 +5,7 @@ import { SchedulerService } from '../scheduler';
5
5
  import { GateService } from '../gate';
6
6
  import { LogService } from '../log';
7
7
  import { HandlerExecutor } from '../handler-executor';
8
- import { ActorRegistry } from '../actor-registry';
8
+ import { EntityTypeRegistry } from '../entity-type-registry';
9
9
  export declare class ExecutorPoolService implements OnModuleInit, OnApplicationShutdown {
10
10
  private readonly redis;
11
11
  private readonly config;
@@ -13,7 +13,7 @@ export declare class ExecutorPoolService implements OnModuleInit, OnApplicationS
13
13
  private readonly gateService;
14
14
  private readonly logService;
15
15
  private readonly handlerExecutor;
16
- private readonly actorRegistry;
16
+ private readonly entityTypeRegistry;
17
17
  private readonly logger;
18
18
  private readonly keyPrefix;
19
19
  private readonly poolSize;
@@ -21,7 +21,7 @@ export declare class ExecutorPoolService implements OnModuleInit, OnApplicationS
21
21
  private running;
22
22
  private subscriberClient;
23
23
  private ownedEntityTypes;
24
- constructor(redis: Redis, config: IAtomicQueuesModuleConfig, scheduler: SchedulerService, gateService: GateService, logService: LogService, handlerExecutor: HandlerExecutor, actorRegistry: ActorRegistry);
24
+ constructor(redis: Redis, config: IAtomicQueuesModuleConfig, scheduler: SchedulerService, gateService: GateService, logService: LogService, handlerExecutor: HandlerExecutor, entityTypeRegistry: EntityTypeRegistry);
25
25
  onModuleInit(): Promise<void>;
26
26
  onApplicationShutdown(): Promise<void>;
27
27
  tickle(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"executor-pool.service.d.ts","sourceRoot":"","sources":["../../../src/services/executor-pool/executor-pool.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,YAAY,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAsB,MAAM,cAAc,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,c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,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB7B,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBtC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;YAKf,WAAW;YAkBX,cAAc;YA8Bd,aAAa;IAW3B;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;CAuBhC"}
@@ -24,17 +24,17 @@ const scheduler_1 = require("../scheduler");
24
24
  const gate_1 = require("../gate");
25
25
  const log_1 = require("../log");
26
26
  const handler_executor_1 = require("../handler-executor");
27
- const actor_registry_1 = require("../actor-registry");
27
+ const entity_type_registry_1 = require("../entity-type-registry");
28
28
  const constants_1 = require("../constants");
29
29
  let ExecutorPoolService = ExecutorPoolService_1 = class ExecutorPoolService {
30
- constructor(redis, config, scheduler, gateService, logService, handlerExecutor, actorRegistry) {
30
+ constructor(redis, config, scheduler, gateService, logService, handlerExecutor, entityTypeRegistry) {
31
31
  this.redis = redis;
32
32
  this.config = config;
33
33
  this.scheduler = scheduler;
34
34
  this.gateService = gateService;
35
35
  this.logService = logService;
36
36
  this.handlerExecutor = handlerExecutor;
37
- this.actorRegistry = actorRegistry;
37
+ this.entityTypeRegistry = entityTypeRegistry;
38
38
  this.logger = new common_1.Logger(ExecutorPoolService_1.name);
39
39
  this.activeExecutors = 0;
40
40
  this.running = false;
@@ -107,19 +107,6 @@ let ExecutorPoolService = ExecutorPoolService_1 = class ExecutorPoolService {
107
107
  }
108
108
  }, refreshInterval);
109
109
  try {
110
- if (this.actorRegistry.hasActor(entityType)) {
111
- const actor = await this.actorRegistry.getOrCreateInstance(entityType, entityId);
112
- const methodName = this.actorRegistry.getHandlerMethod(entityType, message.name);
113
- if (actor && methodName) {
114
- const handler = actor[methodName];
115
- if (typeof handler === 'function') {
116
- const result = await handler.call(actor, { ...message.data });
117
- await this.publishResult(message, result);
118
- await this.scheduler.complete(entityKey, ownerToken);
119
- return;
120
- }
121
- }
122
- }
123
110
  const result = await this.handlerExecutor.execute(message, entityKey);
124
111
  await this.publishResult(message, result);
125
112
  await this.scheduler.complete(entityKey, ownerToken);
@@ -146,8 +133,7 @@ let ExecutorPoolService = ExecutorPoolService_1 = class ExecutorPoolService {
146
133
  */
147
134
  collectOwnedEntityTypes() {
148
135
  const types = new Set();
149
- // Actor entity types
150
- for (const et of this.actorRegistry.getRegisteredEntityTypes()) {
136
+ for (const et of this.entityTypeRegistry.getRegisteredEntityTypes()) {
151
137
  types.add(et);
152
138
  }
153
139
  // Entity types declared in config
@@ -175,6 +161,6 @@ exports.ExecutorPoolService = ExecutorPoolService = ExecutorPoolService_1 = __de
175
161
  gate_1.GateService,
176
162
  log_1.LogService,
177
163
  handler_executor_1.HandlerExecutor,
178
- actor_registry_1.ActorRegistry])
164
+ entity_type_registry_1.EntityTypeRegistry])
179
165
  ], ExecutorPoolService);
180
166
  //# sourceMappingURL=executor-pool.service.js.map