@event-driven-platform/reader 0.0.3

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 (79) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +102 -0
  3. package/dist/index.d.ts +12 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +9 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/lib/cache/cached-read-executor.d.ts +20 -0
  8. package/dist/lib/cache/cached-read-executor.d.ts.map +1 -0
  9. package/dist/lib/cache/cached-read-executor.js +69 -0
  10. package/dist/lib/cache/cached-read-executor.js.map +1 -0
  11. package/dist/lib/cache/read-cache-traversal.d.ts +10 -0
  12. package/dist/lib/cache/read-cache-traversal.d.ts.map +1 -0
  13. package/dist/lib/cache/read-cache-traversal.js +30 -0
  14. package/dist/lib/cache/read-cache-traversal.js.map +1 -0
  15. package/dist/lib/control/default-read-timeout.d.ts +5 -0
  16. package/dist/lib/control/default-read-timeout.d.ts.map +1 -0
  17. package/dist/lib/control/default-read-timeout.js +30 -0
  18. package/dist/lib/control/default-read-timeout.js.map +1 -0
  19. package/dist/lib/control/read-execution-control.d.ts +12 -0
  20. package/dist/lib/control/read-execution-control.d.ts.map +1 -0
  21. package/dist/lib/control/read-execution-control.js +43 -0
  22. package/dist/lib/control/read-execution-control.js.map +1 -0
  23. package/dist/lib/control/read-timeout.d.ts +10 -0
  24. package/dist/lib/control/read-timeout.d.ts.map +1 -0
  25. package/dist/lib/control/read-timeout.js +2 -0
  26. package/dist/lib/control/read-timeout.js.map +1 -0
  27. package/dist/lib/errors/read-cancelled.error.d.ts +4 -0
  28. package/dist/lib/errors/read-cancelled.error.d.ts.map +1 -0
  29. package/dist/lib/errors/read-cancelled.error.js +7 -0
  30. package/dist/lib/errors/read-cancelled.error.js.map +1 -0
  31. package/dist/lib/errors/read-execution-coordination-not-configured.error.d.ts +4 -0
  32. package/dist/lib/errors/read-execution-coordination-not-configured.error.d.ts.map +1 -0
  33. package/dist/lib/errors/read-execution-coordination-not-configured.error.js +7 -0
  34. package/dist/lib/errors/read-execution-coordination-not-configured.error.js.map +1 -0
  35. package/dist/lib/errors/read-execution-coordinator-unavailable.error.d.ts +4 -0
  36. package/dist/lib/errors/read-execution-coordinator-unavailable.error.d.ts.map +1 -0
  37. package/dist/lib/errors/read-execution-coordinator-unavailable.error.js +7 -0
  38. package/dist/lib/errors/read-execution-coordinator-unavailable.error.js.map +1 -0
  39. package/dist/lib/errors/read-execution-ownership-lost.error.d.ts +4 -0
  40. package/dist/lib/errors/read-execution-ownership-lost.error.d.ts.map +1 -0
  41. package/dist/lib/errors/read-execution-ownership-lost.error.js +7 -0
  42. package/dist/lib/errors/read-execution-ownership-lost.error.js.map +1 -0
  43. package/dist/lib/errors/read-handler-ambiguous.error.d.ts +5 -0
  44. package/dist/lib/errors/read-handler-ambiguous.error.d.ts.map +1 -0
  45. package/dist/lib/errors/read-handler-ambiguous.error.js +9 -0
  46. package/dist/lib/errors/read-handler-ambiguous.error.js.map +1 -0
  47. package/dist/lib/errors/read-handler-not-found.error.d.ts +4 -0
  48. package/dist/lib/errors/read-handler-not-found.error.d.ts.map +1 -0
  49. package/dist/lib/errors/read-handler-not-found.error.js +7 -0
  50. package/dist/lib/errors/read-handler-not-found.error.js.map +1 -0
  51. package/dist/lib/errors/read-timed-out.error.d.ts +5 -0
  52. package/dist/lib/errors/read-timed-out.error.d.ts.map +1 -0
  53. package/dist/lib/errors/read-timed-out.error.js +9 -0
  54. package/dist/lib/errors/read-timed-out.error.js.map +1 -0
  55. package/dist/lib/inflight/distributed-read-flight.d.ts +26 -0
  56. package/dist/lib/inflight/distributed-read-flight.d.ts.map +1 -0
  57. package/dist/lib/inflight/distributed-read-flight.js +122 -0
  58. package/dist/lib/inflight/distributed-read-flight.js.map +1 -0
  59. package/dist/lib/inflight/local-read-in-flight.d.ts +7 -0
  60. package/dist/lib/inflight/local-read-in-flight.d.ts.map +1 -0
  61. package/dist/lib/inflight/local-read-in-flight.js +21 -0
  62. package/dist/lib/inflight/local-read-in-flight.js.map +1 -0
  63. package/dist/lib/reader/default-reader-dependencies.d.ts +10 -0
  64. package/dist/lib/reader/default-reader-dependencies.d.ts.map +1 -0
  65. package/dist/lib/reader/default-reader-dependencies.js +2 -0
  66. package/dist/lib/reader/default-reader-dependencies.js.map +1 -0
  67. package/dist/lib/reader/default-reader.d.ts +13 -0
  68. package/dist/lib/reader/default-reader.d.ts.map +1 -0
  69. package/dist/lib/reader/default-reader.js +27 -0
  70. package/dist/lib/reader/default-reader.js.map +1 -0
  71. package/dist/lib/reader/reader.d.ts +6 -0
  72. package/dist/lib/reader/reader.d.ts.map +1 -0
  73. package/dist/lib/reader/reader.js +2 -0
  74. package/dist/lib/reader/reader.js.map +1 -0
  75. package/dist/lib/source/read-source-executor.d.ts +9 -0
  76. package/dist/lib/source/read-source-executor.d.ts.map +1 -0
  77. package/dist/lib/source/read-source-executor.js +24 -0
  78. package/dist/lib/source/read-source-executor.js.map +1 -0
  79. package/package.json +45 -0
@@ -0,0 +1,7 @@
1
+ export class ReadCancelledError extends Error {
2
+ constructor() {
3
+ super('Read execution was cancelled.');
4
+ this.name = 'ReadCancelledError';
5
+ }
6
+ }
7
+ //# sourceMappingURL=read-cancelled.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-cancelled.error.js","sourceRoot":"","sources":["../../../src/lib/errors/read-cancelled.error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACzC;QACI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACrC,CAAC;CACJ"}
@@ -0,0 +1,4 @@
1
+ export declare class ReadExecutionCoordinationNotConfiguredError extends Error {
2
+ constructor(reason: string);
3
+ }
4
+ //# sourceMappingURL=read-execution-coordination-not-configured.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-execution-coordination-not-configured.error.d.ts","sourceRoot":"","sources":["../../../src/lib/errors/read-execution-coordination-not-configured.error.ts"],"names":[],"mappings":"AAAA,qBAAa,2CAA4C,SAAQ,KAAK;gBACtD,MAAM,EAAE,MAAM;CAI7B"}
@@ -0,0 +1,7 @@
1
+ export class ReadExecutionCoordinationNotConfiguredError extends Error {
2
+ constructor(reason) {
3
+ super(`Distributed read coordination is not configured: ${reason}`);
4
+ this.name = 'ReadExecutionCoordinationNotConfiguredError';
5
+ }
6
+ }
7
+ //# sourceMappingURL=read-execution-coordination-not-configured.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-execution-coordination-not-configured.error.js","sourceRoot":"","sources":["../../../src/lib/errors/read-execution-coordination-not-configured.error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,2CAA4C,SAAQ,KAAK;IAClE,YAAY,MAAc;QACtB,KAAK,CAAC,oDAAoD,MAAM,EAAE,CAAC,CAAC;QACpE,IAAI,CAAC,IAAI,GAAG,6CAA6C,CAAC;IAC9D,CAAC;CACJ"}
@@ -0,0 +1,4 @@
1
+ export declare class ReadExecutionCoordinatorUnavailableError extends Error {
2
+ constructor(reason: string);
3
+ }
4
+ //# sourceMappingURL=read-execution-coordinator-unavailable.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-execution-coordinator-unavailable.error.d.ts","sourceRoot":"","sources":["../../../src/lib/errors/read-execution-coordinator-unavailable.error.ts"],"names":[],"mappings":"AAAA,qBAAa,wCAAyC,SAAQ,KAAK;gBACnD,MAAM,EAAE,MAAM;CAI7B"}
@@ -0,0 +1,7 @@
1
+ export class ReadExecutionCoordinatorUnavailableError extends Error {
2
+ constructor(reason) {
3
+ super(`Read execution coordinator is unavailable: ${reason}`);
4
+ this.name = 'ReadExecutionCoordinatorUnavailableError';
5
+ }
6
+ }
7
+ //# sourceMappingURL=read-execution-coordinator-unavailable.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-execution-coordinator-unavailable.error.js","sourceRoot":"","sources":["../../../src/lib/errors/read-execution-coordinator-unavailable.error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,wCAAyC,SAAQ,KAAK;IAC/D,YAAY,MAAc;QACtB,KAAK,CAAC,8CAA8C,MAAM,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,0CAA0C,CAAC;IAC3D,CAAC;CACJ"}
@@ -0,0 +1,4 @@
1
+ export declare class ReadExecutionOwnershipLostError extends Error {
2
+ constructor();
3
+ }
4
+ //# sourceMappingURL=read-execution-ownership-lost.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-execution-ownership-lost.error.d.ts","sourceRoot":"","sources":["../../../src/lib/errors/read-execution-ownership-lost.error.ts"],"names":[],"mappings":"AAAA,qBAAa,+BAAgC,SAAQ,KAAK;;CAKzD"}
@@ -0,0 +1,7 @@
1
+ export class ReadExecutionOwnershipLostError extends Error {
2
+ constructor() {
3
+ super('Distributed read execution ownership was lost before the result could be published.');
4
+ this.name = 'ReadExecutionOwnershipLostError';
5
+ }
6
+ }
7
+ //# sourceMappingURL=read-execution-ownership-lost.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-execution-ownership-lost.error.js","sourceRoot":"","sources":["../../../src/lib/errors/read-execution-ownership-lost.error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,+BAAgC,SAAQ,KAAK;IACtD;QACI,KAAK,CAAC,qFAAqF,CAAC,CAAC;QAC7F,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC;IAClD,CAAC;CACJ"}
@@ -0,0 +1,5 @@
1
+ export declare class ReadHandlerAmbiguousError extends Error {
2
+ readonly reason: string;
3
+ constructor(reason: string);
4
+ }
5
+ //# sourceMappingURL=read-handler-ambiguous.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-handler-ambiguous.error.d.ts","sourceRoot":"","sources":["../../../src/lib/errors/read-handler-ambiguous.error.ts"],"names":[],"mappings":"AAAA,qBAAa,yBAA0B,SAAQ,KAAK;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;CAItC"}
@@ -0,0 +1,9 @@
1
+ export class ReadHandlerAmbiguousError extends Error {
2
+ reason;
3
+ constructor(reason) {
4
+ super(`ReadHandler resolution is ambiguous: ${reason}`);
5
+ this.reason = reason;
6
+ this.name = 'ReadHandlerAmbiguousError';
7
+ }
8
+ }
9
+ //# sourceMappingURL=read-handler-ambiguous.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-handler-ambiguous.error.js","sourceRoot":"","sources":["../../../src/lib/errors/read-handler-ambiguous.error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAC3B;IAArB,YAAqB,MAAc;QAC/B,KAAK,CAAC,wCAAwC,MAAM,EAAE,CAAC,CAAC;QADvC,WAAM,GAAN,MAAM,CAAQ;QAE/B,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC5C,CAAC;CACJ"}
@@ -0,0 +1,4 @@
1
+ export declare class ReadHandlerNotFoundError extends Error {
2
+ constructor();
3
+ }
4
+ //# sourceMappingURL=read-handler-not-found.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-handler-not-found.error.d.ts","sourceRoot":"","sources":["../../../src/lib/errors/read-handler-not-found.error.ts"],"names":[],"mappings":"AAAA,qBAAa,wBAAyB,SAAQ,KAAK;;CAKlD"}
@@ -0,0 +1,7 @@
1
+ export class ReadHandlerNotFoundError extends Error {
2
+ constructor() {
3
+ super('No ReadHandler is available for the requested Read.');
4
+ this.name = 'ReadHandlerNotFoundError';
5
+ }
6
+ }
7
+ //# sourceMappingURL=read-handler-not-found.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-handler-not-found.error.js","sourceRoot":"","sources":["../../../src/lib/errors/read-handler-not-found.error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAC/C;QACI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IAC3C,CAAC;CACJ"}
@@ -0,0 +1,5 @@
1
+ export declare class ReadTimedOutError extends Error {
2
+ readonly timeoutMs: number;
3
+ constructor(timeoutMs: number);
4
+ }
5
+ //# sourceMappingURL=read-timed-out.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-timed-out.error.d.ts","sourceRoot":"","sources":["../../../src/lib/errors/read-timed-out.error.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAkB,SAAQ,KAAK;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM;gBAAjB,SAAS,EAAE,MAAM;CAIzC"}
@@ -0,0 +1,9 @@
1
+ export class ReadTimedOutError extends Error {
2
+ timeoutMs;
3
+ constructor(timeoutMs) {
4
+ super(`Read execution timed out after ${timeoutMs}ms.`);
5
+ this.timeoutMs = timeoutMs;
6
+ this.name = 'ReadTimedOutError';
7
+ }
8
+ }
9
+ //# sourceMappingURL=read-timed-out.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-timed-out.error.js","sourceRoot":"","sources":["../../../src/lib/errors/read-timed-out.error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACnB;IAArB,YAAqB,SAAiB;QAClC,KAAK,CAAC,kCAAkC,SAAS,KAAK,CAAC,CAAC;QADvC,cAAS,GAAT,SAAS,CAAQ;QAElC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IACpC,CAAC;CACJ"}
@@ -0,0 +1,26 @@
1
+ import type { ReadExecutionCoordinator } from '@event-driven-platform/read-execution-coordinator';
2
+ import type { ReadCacheKey } from '@event-driven-platform/query';
3
+ type SharedReadResult<TResult> = {
4
+ readonly status: 'hit';
5
+ readonly value: TResult;
6
+ } | {
7
+ readonly status: 'miss';
8
+ };
9
+ interface DistributedReadFlightRequest<TResult> {
10
+ readonly key: ReadCacheKey;
11
+ readonly ownerId: string;
12
+ readonly leaseDurationMs: number;
13
+ readonly readShared: () => Promise<SharedReadResult<TResult>>;
14
+ readonly executeSource: () => Promise<TResult>;
15
+ readonly publishSourceResult: (result: TResult) => Promise<void>;
16
+ }
17
+ export declare class DistributedReadFlight {
18
+ private readonly coordinator;
19
+ constructor(coordinator: ReadExecutionCoordinator);
20
+ run<TResult>(request: DistributedReadFlightRequest<TResult>): Promise<TResult>;
21
+ private waitForCurrentFlight;
22
+ private runAsOwner;
23
+ private assertOwnership;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=distributed-read-flight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distributed-read-flight.d.ts","sourceRoot":"","sources":["../../../src/lib/inflight/distributed-read-flight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,wBAAwB,EAE3B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAKjE,KAAK,gBAAgB,CAAC,OAAO,IACvB;IAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,UAAU,4BAA4B,CAAC,OAAO;IAC1C,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,aAAa,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,QAAQ,CAAC,mBAAmB,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpE;AAED,qBAAa,qBAAqB;IAClB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,wBAAwB;IAE5D,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,4BAA4B,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;YAyBtE,oBAAoB;YAepB,UAAU;IA2FxB,OAAO,CAAC,eAAe;CAc1B"}
@@ -0,0 +1,122 @@
1
+ import { ReadExecutionCoordinatorUnavailableError } from '../errors/read-execution-coordinator-unavailable.error.js';
2
+ import { ReadExecutionOwnershipLostError } from '../errors/read-execution-ownership-lost.error.js';
3
+ export class DistributedReadFlight {
4
+ coordinator;
5
+ constructor(coordinator) {
6
+ this.coordinator = coordinator;
7
+ }
8
+ async run(request) {
9
+ while (true) {
10
+ const claim = await this.coordinator.claim({
11
+ key: request.key,
12
+ ownerId: request.ownerId,
13
+ leaseDurationMs: request.leaseDurationMs,
14
+ });
15
+ if (claim.status === 'unavailable') {
16
+ throw new ReadExecutionCoordinatorUnavailableError(claim.reason);
17
+ }
18
+ if (claim.status === 'already-in-progress') {
19
+ const afterWait = await this.waitForCurrentFlight(request);
20
+ if (afterWait.status === 'hit') {
21
+ return afterWait.value;
22
+ }
23
+ continue;
24
+ }
25
+ return this.runAsOwner(request, claim.lease);
26
+ }
27
+ }
28
+ async waitForCurrentFlight(request) {
29
+ const wait = await this.coordinator.wait({
30
+ key: request.key,
31
+ timeoutMs: request.leaseDurationMs,
32
+ });
33
+ if (wait.status === 'unavailable') {
34
+ throw new ReadExecutionCoordinatorUnavailableError(wait.reason);
35
+ }
36
+ return request.readShared();
37
+ }
38
+ async runAsOwner(request, lease) {
39
+ let leaseState = 'owned';
40
+ let unavailableReason;
41
+ let stopped = false;
42
+ let timer;
43
+ let renewing;
44
+ const intervalMs = Math.max(1, Math.floor(request.leaseDurationMs / 2));
45
+ const scheduleRenewal = () => {
46
+ timer = setTimeout(() => {
47
+ renewing = renew().finally(() => {
48
+ renewing = undefined;
49
+ });
50
+ }, intervalMs);
51
+ };
52
+ const renew = async () => {
53
+ if (stopped || leaseState !== 'owned') {
54
+ return;
55
+ }
56
+ const result = await this.coordinator.renew({
57
+ key: request.key,
58
+ lease,
59
+ leaseDurationMs: request.leaseDurationMs,
60
+ });
61
+ if (result.status === 'ownership-lost') {
62
+ leaseState = 'lost';
63
+ return;
64
+ }
65
+ if (result.status === 'unavailable') {
66
+ leaseState = 'unavailable';
67
+ unavailableReason = result.reason;
68
+ return;
69
+ }
70
+ if (!stopped) {
71
+ scheduleRenewal();
72
+ }
73
+ };
74
+ const synchronizeRenewal = async () => {
75
+ if (renewing !== undefined) {
76
+ await renewing;
77
+ }
78
+ this.assertOwnership(leaseState, unavailableReason);
79
+ };
80
+ scheduleRenewal();
81
+ try {
82
+ const sharedResult = await request.readShared();
83
+ if (sharedResult.status === 'hit') {
84
+ return sharedResult.value;
85
+ }
86
+ const sourceResult = await request.executeSource();
87
+ await synchronizeRenewal();
88
+ await request.publishSourceResult(sourceResult);
89
+ await synchronizeRenewal();
90
+ return sourceResult;
91
+ }
92
+ finally {
93
+ stopped = true;
94
+ if (timer !== undefined) {
95
+ clearTimeout(timer);
96
+ }
97
+ if (renewing !== undefined) {
98
+ try {
99
+ await renewing;
100
+ }
101
+ catch {
102
+ // Renewal failure has already been represented through coordinator outcomes.
103
+ }
104
+ }
105
+ try {
106
+ await this.coordinator.release({ key: request.key, lease });
107
+ }
108
+ catch {
109
+ // The lease is TTL-bounded; release failure must not replace a completed business read.
110
+ }
111
+ }
112
+ }
113
+ assertOwnership(leaseState, unavailableReason) {
114
+ if (leaseState === 'lost') {
115
+ throw new ReadExecutionOwnershipLostError();
116
+ }
117
+ if (leaseState === 'unavailable') {
118
+ throw new ReadExecutionCoordinatorUnavailableError(unavailableReason ?? 'lease renewal failed');
119
+ }
120
+ }
121
+ }
122
+ //# sourceMappingURL=distributed-read-flight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distributed-read-flight.js","sourceRo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AC;YAAC,MAAM,CAAC;gBACL,wFAAwF;YAC5F,CAAC;QACL,CAAC;IACL,CAAC;IAEO,eAAe,CACnB,UAA4C,EAC5C,iBAAqC;QAErC,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;YACxB,MAAM,IAAI,+BAA+B,EAAE,CAAC;QAChD,CAAC;QAED,IAAI,UAAU,KAAK,aAAa,EAAE,CAAC;YAC/B,MAAM,IAAI,wCAAwC,CAC9C,iBAAiB,IAAI,sBAAsB,CAC9C,CAAC;QACN,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,7 @@
1
+ import type { ReadCacheKey } from '@event-driven-platform/query';
2
+ export declare class LocalReadInFlight {
3
+ private readonly flights;
4
+ run<TResult>(key: ReadCacheKey, execute: () => Promise<TResult>): Promise<TResult>;
5
+ private identityOf;
6
+ }
7
+ //# sourceMappingURL=local-read-in-flight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-read-in-flight.d.ts","sourceRoot":"","sources":["../../../src/lib/inflight/local-read-in-flight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuC;IAE/D,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBlF,OAAO,CAAC,UAAU;CAGrB"}
@@ -0,0 +1,21 @@
1
+ export class LocalReadInFlight {
2
+ flights = new Map();
3
+ run(key, execute) {
4
+ const identity = this.identityOf(key);
5
+ const active = this.flights.get(identity);
6
+ if (active !== undefined) {
7
+ return active;
8
+ }
9
+ const flight = execute().finally(() => {
10
+ if (this.flights.get(identity) === flight) {
11
+ this.flights.delete(identity);
12
+ }
13
+ });
14
+ this.flights.set(identity, flight);
15
+ return flight;
16
+ }
17
+ identityOf(key) {
18
+ return JSON.stringify([key.namespace, key.version, key.partition, key.value]);
19
+ }
20
+ }
21
+ //# sourceMappingURL=local-read-in-flight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-read-in-flight.js","sourceRoot":"","sources":["../../../src/lib/inflight/local-read-in-flight.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,iBAAiB;IACT,OAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;IAE/D,GAAG,CAAU,GAAiB,EAAE,OAA+B;QAC3D,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAE1C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,MAA0B,CAAC;QACtC,CAAC;QAED,MAAM,MAAM,GAAG,OAAO,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;YAClC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,MAAM,EAAE,CAAC;gBACxC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAEnC,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,UAAU,CAAC,GAAiB;QAChC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAClF,CAAC;CACJ"}
@@ -0,0 +1,10 @@
1
+ import type { ReadExecutionCoordinator } from '@event-driven-platform/read-execution-coordinator';
2
+ import type { ReadHandlerResolver } from '@event-driven-platform/read-handler-resolver';
3
+ import type { ReadTimeout } from '../control/read-timeout.js';
4
+ export interface DefaultReaderDependencies {
5
+ readonly readHandlerResolver: ReadHandlerResolver;
6
+ readonly readTimeout?: ReadTimeout;
7
+ readonly readExecutionCoordinator?: ReadExecutionCoordinator;
8
+ readonly readExecutionOwnerIdFactory?: () => string;
9
+ }
10
+ //# sourceMappingURL=default-reader-dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-reader-dependencies.d.ts","sourceRoot":"","sources":["../../../src/lib/reader/default-reader-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAExF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,yBAAyB;IACtC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAClD,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IAC7D,QAAQ,CAAC,2BAA2B,CAAC,EAAE,MAAM,MAAM,CAAC;CACvD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=default-reader-dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-reader-dependencies.js","sourceRoot":"","sources":["../../../src/lib/reader/default-reader-dependencies.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import type { Query } from '@event-driven-platform/query';
2
+ import type { AnyRead, ReadResultOf } from '@event-driven-platform/read';
3
+ import type { DefaultReaderDependencies } from './default-reader-dependencies.js';
4
+ import type { Reader } from './reader.js';
5
+ export type { DefaultReaderDependencies } from './default-reader-dependencies.js';
6
+ export declare class DefaultReader implements Reader {
7
+ private readonly sourceExecutor;
8
+ private readonly cachedExecutor;
9
+ private readonly executionControl;
10
+ constructor(dependencies: DefaultReaderDependencies);
11
+ execute<TRead extends AnyRead>(query: Query<TRead>): Promise<ReadResultOf<TRead>>;
12
+ }
13
+ //# sourceMappingURL=default-reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-reader.d.ts","sourceRoot":"","sources":["../../../src/lib/reader/default-reader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAMzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,YAAY,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAElF,qBAAa,aAAc,YAAW,MAAM;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;IACpD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;IACpD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuB;gBAErC,YAAY,EAAE,yBAAyB;IAYnD,OAAO,CAAC,KAAK,SAAS,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;CAS3F"}
@@ -0,0 +1,27 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { CachedReadExecutor } from '../cache/cached-read-executor.js';
3
+ import { DefaultReadTimeout } from '../control/default-read-timeout.js';
4
+ import { ReadExecutionControl } from '../control/read-execution-control.js';
5
+ import { ReadSourceExecutor } from '../source/read-source-executor.js';
6
+ export class DefaultReader {
7
+ sourceExecutor;
8
+ cachedExecutor;
9
+ executionControl;
10
+ constructor(dependencies) {
11
+ this.sourceExecutor = new ReadSourceExecutor(dependencies.readHandlerResolver);
12
+ this.cachedExecutor = new CachedReadExecutor({
13
+ sourceExecutor: this.sourceExecutor,
14
+ readExecutionCoordinator: dependencies.readExecutionCoordinator,
15
+ ownerIdFactory: dependencies.readExecutionOwnerIdFactory ?? randomUUID,
16
+ });
17
+ this.executionControl = new ReadExecutionControl(dependencies.readTimeout ?? new DefaultReadTimeout());
18
+ }
19
+ execute(query) {
20
+ const cachePlan = query.options?.cache;
21
+ const work = cachePlan === undefined
22
+ ? () => this.sourceExecutor.execute(query.read)
23
+ : () => this.cachedExecutor.execute(query, cachePlan);
24
+ return this.executionControl.execute(work, query.options);
25
+ }
26
+ }
27
+ //# sourceMappingURL=default-reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-reader.js","sourceRoot":"","sources":["../../../src/lib/reader/default-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAMvE,MAAM,OAAO,aAAa;IACL,cAAc,CAAqB;IACnC,cAAc,CAAqB;IACnC,gBAAgB,CAAuB;IAExD,YAAmB,YAAuC;QACtD,IAAI,CAAC,cAAc,GAAG,IAAI,kBAAkB,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAC/E,IAAI,CAAC,cAAc,GAAG,IAAI,kBAAkB,CAAC;YACzC,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,wBAAwB,EAAE,YAAY,CAAC,wBAAwB;YAC/D,cAAc,EAAE,YAAY,CAAC,2BAA2B,IAAI,UAAU;SACzE,CAAC,CAAC;QACH,IAAI,CAAC,gBAAgB,GAAG,IAAI,oBAAoB,CAC5C,YAAY,CAAC,WAAW,IAAI,IAAI,kBAAkB,EAAE,CACvD,CAAC;IACN,CAAC;IAEM,OAAO,CAAwB,KAAmB;QACrD,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC;QACvC,MAAM,IAAI,GACN,SAAS,KAAK,SAAS;YACnB,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;YAC/C,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAE9D,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;CACJ"}
@@ -0,0 +1,6 @@
1
+ import type { Query } from '@event-driven-platform/query';
2
+ import type { AnyRead, ReadResultOf } from '@event-driven-platform/read';
3
+ export interface Reader {
4
+ execute<TRead extends AnyRead>(query: Query<TRead>): Promise<ReadResultOf<TRead>>;
5
+ }
6
+ //# sourceMappingURL=reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../../src/lib/reader/reader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEzE,MAAM,WAAW,MAAM;IACnB,OAAO,CAAC,KAAK,SAAS,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;CACrF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader.js","sourceRoot":"","sources":["../../../src/lib/reader/reader.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import type { AnyRead, ReadResultOf } from '@event-driven-platform/read';
2
+ import type { ReadHandlerResolver } from '@event-driven-platform/read-handler-resolver';
3
+ export declare class ReadSourceExecutor {
4
+ private readonly readHandlerResolver;
5
+ constructor(readHandlerResolver: ReadHandlerResolver);
6
+ execute<TRead extends AnyRead>(read: TRead): Promise<ReadResultOf<TRead>>;
7
+ private resolveHandler;
8
+ }
9
+ //# sourceMappingURL=read-source-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-source-executor.d.ts","sourceRoot":"","sources":["../../../src/lib/source/read-source-executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAyB,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAK/G,qBAAa,kBAAkB;IACR,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,mBAAmB;IAErE,OAAO,CAAC,KAAK,SAAS,OAAO,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAOhF,OAAO,CAAC,cAAc;CAUzB"}
@@ -0,0 +1,24 @@
1
+ import { ReadHandlerAmbiguousError } from '../errors/read-handler-ambiguous.error.js';
2
+ import { ReadHandlerNotFoundError } from '../errors/read-handler-not-found.error.js';
3
+ export class ReadSourceExecutor {
4
+ readHandlerResolver;
5
+ constructor(readHandlerResolver) {
6
+ this.readHandlerResolver = readHandlerResolver;
7
+ }
8
+ execute(read) {
9
+ const resolution = this.readHandlerResolver.resolve(read);
10
+ const handler = this.resolveHandler(resolution);
11
+ return handler.execute(read);
12
+ }
13
+ resolveHandler(resolution) {
14
+ switch (resolution.status) {
15
+ case 'resolved':
16
+ return resolution.handlers[0];
17
+ case 'not-found':
18
+ throw new ReadHandlerNotFoundError();
19
+ case 'ambiguous':
20
+ throw new ReadHandlerAmbiguousError(resolution.reason);
21
+ }
22
+ }
23
+ }
24
+ //# sourceMappingURL=read-source-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-source-executor.js","sourceRoot":"","sources":["../../../src/lib/source/read-source-executor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAErF,MAAM,OAAO,kBAAkB;IACS;IAApC,YAAoC,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAEzE,OAAO,CAAwB,IAAW;QAC7C,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QAEhD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAEO,cAAc,CAAwB,UAAwC;QAClF,QAAQ,UAAU,CAAC,MAAM,EAAE,CAAC;YACxB,KAAK,UAAU;gBACX,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAClC,KAAK,WAAW;gBACZ,MAAM,IAAI,wBAAwB,EAAE,CAAC;YACzC,KAAK,WAAW;gBACZ,MAAM,IAAI,yBAAyB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;IACL,CAAC;CACJ"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@event-driven-platform/reader",
3
+ "version": "0.0.3",
4
+ "description": "Centralized execution engine for Queries, cache traversal, coalescing, and ReadHandler dispatch.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist/**/*.js",
11
+ "dist/**/*.js.map",
12
+ "dist/**/*.d.ts",
13
+ "dist/**/*.d.ts.map"
14
+ ],
15
+ "exports": {
16
+ "./package.json": "./package.json",
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "default": "./dist/index.js"
21
+ }
22
+ },
23
+ "license": "Apache-2.0",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/sanshan/event-driven-platform.git",
27
+ "directory": "packages/reader"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "dependencies": {
33
+ "tslib": "^2.3.0",
34
+ "@event-driven-platform/query": "0.0.4",
35
+ "@event-driven-platform/read": "0.0.4",
36
+ "@event-driven-platform/read-execution-coordinator": "0.0.3",
37
+ "@event-driven-platform/read-handler-resolver": "0.0.3"
38
+ },
39
+ "devDependencies": {
40
+ "redis": "^6.2.1",
41
+ "@event-driven-platform/read-cache-in-memory": "0.0.3",
42
+ "@event-driven-platform/read-cache-redis": "0.0.3",
43
+ "@event-driven-platform/read-execution-coordinator-redis": "0.0.3"
44
+ }
45
+ }