@resonatehq/sdk 0.6.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -45
- package/dist/dev/network.d.ts +16 -0
- package/dist/dev/network.d.ts.map +1 -0
- package/dist/dev/network.js +89 -0
- package/dist/dev/network.js.map +1 -0
- package/dist/dev/server.d.ts +87 -0
- package/dist/dev/server.d.ts.map +1 -0
- package/dist/dev/server.js +891 -0
- package/dist/dev/server.js.map +1 -0
- package/dist/sim/example-1.d.ts +2 -0
- package/dist/sim/example-1.d.ts.map +1 -0
- package/dist/sim/example-1.js +94 -0
- package/dist/sim/example-1.js.map +1 -0
- package/dist/sim/example-2.d.ts +2 -0
- package/dist/sim/example-2.d.ts.map +1 -0
- package/dist/sim/example-2.js +95 -0
- package/dist/sim/example-2.js.map +1 -0
- package/dist/sim/example-3.d.ts +2 -0
- package/dist/sim/example-3.d.ts.map +1 -0
- package/dist/sim/example-3.js +95 -0
- package/dist/sim/example-3.js.map +1 -0
- package/dist/sim/main.d.ts +14 -0
- package/dist/sim/main.d.ts.map +1 -0
- package/dist/sim/main.js +206 -0
- package/dist/sim/main.js.map +1 -0
- package/dist/sim/src/server.d.ts +15 -0
- package/dist/sim/src/server.d.ts.map +1 -0
- package/dist/sim/src/server.js +85 -0
- package/dist/sim/src/server.js.map +1 -0
- package/dist/sim/src/simulator.d.ts +65 -0
- package/dist/sim/src/simulator.d.ts.map +1 -0
- package/dist/sim/src/simulator.js +235 -0
- package/dist/sim/src/simulator.js.map +1 -0
- package/dist/sim/src/worker.d.ts +22 -0
- package/dist/sim/src/worker.d.ts.map +1 -0
- package/dist/sim/src/worker.js +175 -0
- package/dist/sim/src/worker.js.map +1 -0
- package/dist/src/clock.d.ts +11 -0
- package/dist/src/clock.d.ts.map +1 -0
- package/dist/src/clock.js +17 -0
- package/dist/src/clock.js.map +1 -0
- package/dist/src/computation.d.ts +40 -0
- package/dist/src/computation.d.ts.map +1 -0
- package/dist/src/computation.js +225 -0
- package/dist/src/computation.js.map +1 -0
- package/dist/src/context.d.ts +120 -0
- package/dist/src/context.d.ts.map +1 -0
- package/dist/src/context.js +288 -0
- package/dist/src/context.js.map +1 -0
- package/dist/src/coroutine.d.ts +35 -0
- package/dist/src/coroutine.d.ts.map +1 -0
- package/dist/src/coroutine.js +251 -0
- package/dist/src/coroutine.js.map +1 -0
- package/dist/src/decorator.d.ts +14 -0
- package/dist/src/decorator.d.ts.map +1 -0
- package/dist/src/decorator.js +208 -0
- package/dist/src/decorator.js.map +1 -0
- package/dist/src/handler.d.ts +40 -0
- package/dist/src/handler.d.ts.map +1 -0
- package/dist/src/handler.js +198 -0
- package/dist/src/handler.js.map +1 -0
- package/dist/src/heartbeat.d.ts +22 -0
- package/dist/src/heartbeat.d.ts.map +1 -0
- package/dist/src/heartbeat.js +87 -0
- package/dist/src/heartbeat.js.map +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +25 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/network/network.d.ts +216 -0
- package/dist/src/network/network.d.ts.map +1 -0
- package/dist/{core/logger.js → src/network/network.js} +2 -1
- package/dist/src/network/network.js.map +1 -0
- package/dist/src/network/remote.d.ts +67 -0
- package/dist/src/network/remote.d.ts.map +1 -0
- package/dist/src/network/remote.js +514 -0
- package/dist/src/network/remote.js.map +1 -0
- package/dist/src/nursery.d.ts +19 -0
- package/dist/src/nursery.d.ts.map +1 -0
- package/dist/src/nursery.js +102 -0
- package/dist/src/nursery.js.map +1 -0
- package/dist/src/processor/processor.d.ts +11 -0
- package/dist/src/processor/processor.d.ts.map +1 -0
- package/dist/src/processor/processor.js +24 -0
- package/dist/src/processor/processor.js.map +1 -0
- package/dist/src/promises.d.ts +23 -0
- package/dist/src/promises.d.ts.map +1 -0
- package/dist/src/promises.js +157 -0
- package/dist/src/promises.js.map +1 -0
- package/dist/src/registry.d.ts +15 -0
- package/dist/src/registry.d.ts.map +1 -0
- package/dist/src/registry.js +26 -0
- package/dist/src/registry.js.map +1 -0
- package/dist/src/resonate-inner.d.ts +45 -0
- package/dist/src/resonate-inner.d.ts.map +1 -0
- package/dist/src/resonate-inner.js +157 -0
- package/dist/src/resonate-inner.js.map +1 -0
- package/dist/src/resonate.d.ts +92 -0
- package/dist/src/resonate.d.ts.map +1 -0
- package/dist/src/resonate.js +240 -0
- package/dist/src/resonate.js.map +1 -0
- package/dist/src/schedules.d.ts +9 -0
- package/dist/src/schedules.d.ts.map +1 -0
- package/dist/src/schedules.js +65 -0
- package/dist/src/schedules.js.map +1 -0
- package/dist/src/tasks.d.ts +9 -0
- package/dist/src/tasks.d.ts.map +1 -0
- package/dist/src/tasks.js +61 -0
- package/dist/src/tasks.js.map +1 -0
- package/dist/src/types.d.ts +86 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +14 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/util.d.ts +14 -0
- package/dist/src/util.d.ts.map +1 -0
- package/dist/src/util.js +69 -0
- package/dist/src/util.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +51 -52
- package/dist/core/encoder.d.ts +0 -5
- package/dist/core/encoder.d.ts.map +0 -1
- package/dist/core/encoder.js +0 -3
- package/dist/core/encoder.js.map +0 -1
- package/dist/core/encoders/base64.d.ts +0 -6
- package/dist/core/encoders/base64.d.ts.map +0 -1
- package/dist/core/encoders/base64.js +0 -13
- package/dist/core/encoders/base64.js.map +0 -1
- package/dist/core/encoders/json.d.ts +0 -6
- package/dist/core/encoders/json.d.ts.map +0 -1
- package/dist/core/encoders/json.js +0 -77
- package/dist/core/encoders/json.js.map +0 -1
- package/dist/core/errors.d.ts +0 -24
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/errors.js +0 -42
- package/dist/core/errors.js.map +0 -1
- package/dist/core/logger.d.ts +0 -10
- package/dist/core/logger.d.ts.map +0 -1
- package/dist/core/logger.js.map +0 -1
- package/dist/core/loggers/logger.d.ts +0 -13
- package/dist/core/loggers/logger.d.ts.map +0 -1
- package/dist/core/loggers/logger.js +0 -48
- package/dist/core/loggers/logger.js.map +0 -1
- package/dist/core/options.d.ts +0 -160
- package/dist/core/options.d.ts.map +0 -1
- package/dist/core/options.js +0 -18
- package/dist/core/options.js.map +0 -1
- package/dist/core/promises/promises.d.ts +0 -210
- package/dist/core/promises/promises.d.ts.map +0 -1
- package/dist/core/promises/promises.js +0 -300
- package/dist/core/promises/promises.js.map +0 -1
- package/dist/core/promises/types.d.ts +0 -42
- package/dist/core/promises/types.d.ts.map +0 -1
- package/dist/core/promises/types.js +0 -70
- package/dist/core/promises/types.js.map +0 -1
- package/dist/core/retry.d.ts +0 -37
- package/dist/core/retry.d.ts.map +0 -1
- package/dist/core/retry.js +0 -141
- package/dist/core/retry.js.map +0 -1
- package/dist/core/schedules/schedules.d.ts +0 -22
- package/dist/core/schedules/schedules.d.ts.map +0 -1
- package/dist/core/schedules/schedules.js +0 -29
- package/dist/core/schedules/schedules.js.map +0 -1
- package/dist/core/schedules/types.d.ts +0 -19
- package/dist/core/schedules/types.d.ts.map +0 -1
- package/dist/core/schedules/types.js +0 -8
- package/dist/core/schedules/types.js.map +0 -1
- package/dist/core/storage.d.ts +0 -6
- package/dist/core/storage.d.ts.map +0 -1
- package/dist/core/storage.js +0 -3
- package/dist/core/storage.js.map +0 -1
- package/dist/core/storages/memory.d.ts +0 -8
- package/dist/core/storages/memory.d.ts.map +0 -1
- package/dist/core/storages/memory.js +0 -29
- package/dist/core/storages/memory.js.map +0 -1
- package/dist/core/storages/withTimeout.d.ts +0 -10
- package/dist/core/storages/withTimeout.d.ts.map +0 -1
- package/dist/core/storages/withTimeout.js +0 -44
- package/dist/core/storages/withTimeout.js.map +0 -1
- package/dist/core/store.d.ts +0 -142
- package/dist/core/store.d.ts.map +0 -1
- package/dist/core/store.js +0 -3
- package/dist/core/store.js.map +0 -1
- package/dist/core/stores/local.d.ts +0 -57
- package/dist/core/stores/local.d.ts.map +0 -1
- package/dist/core/stores/local.js +0 -405
- package/dist/core/stores/local.js.map +0 -1
- package/dist/core/stores/remote.d.ts +0 -51
- package/dist/core/stores/remote.d.ts.map +0 -1
- package/dist/core/stores/remote.js +0 -431
- package/dist/core/stores/remote.js.map +0 -1
- package/dist/core/utils.d.ts +0 -85
- package/dist/core/utils.d.ts.map +0 -1
- package/dist/core/utils.js +0 -121
- package/dist/core/utils.js.map +0 -1
- package/dist/index.d.ts +0 -19
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -57
- package/dist/index.js.map +0 -1
- package/dist/resonate.d.ts +0 -337
- package/dist/resonate.d.ts.map +0 -1
- package/dist/resonate.js +0 -730
- package/dist/resonate.js.map +0 -1
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { IEncoder } from "../encoder";
|
|
2
|
-
import { IPromiseStore } from "../store";
|
|
3
|
-
import { DurablePromiseRecord } from "./types";
|
|
4
|
-
/**
|
|
5
|
-
* Durable Promise create options.
|
|
6
|
-
*/
|
|
7
|
-
export type CreateOptions = {
|
|
8
|
-
/**
|
|
9
|
-
* Durable Promise idempotency key.
|
|
10
|
-
*/
|
|
11
|
-
idempotencyKey: string | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Durable Promise headers.
|
|
14
|
-
*/
|
|
15
|
-
headers: Record<string, string>;
|
|
16
|
-
/**
|
|
17
|
-
* Durable Promise param, will be encoded with the provided encoder.
|
|
18
|
-
*/
|
|
19
|
-
param: unknown;
|
|
20
|
-
/**
|
|
21
|
-
* Durable Promise tags.
|
|
22
|
-
*/
|
|
23
|
-
tags: Record<string, string>;
|
|
24
|
-
/**
|
|
25
|
-
* Create the Durable Promise in strict mode.
|
|
26
|
-
*/
|
|
27
|
-
strict: boolean;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Durable Promise complete options.
|
|
31
|
-
*/
|
|
32
|
-
export type CompleteOptions = {
|
|
33
|
-
/**
|
|
34
|
-
* Durable Promise idempotency key.
|
|
35
|
-
*/
|
|
36
|
-
idempotencyKey: string | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* Durable Promise headers.
|
|
39
|
-
*/
|
|
40
|
-
headers: Record<string, string>;
|
|
41
|
-
/**
|
|
42
|
-
* Create the Durable Promise in strict mode.
|
|
43
|
-
*/
|
|
44
|
-
strict: boolean;
|
|
45
|
-
};
|
|
46
|
-
export declare class DurablePromise<T> {
|
|
47
|
-
private store;
|
|
48
|
-
private encoder;
|
|
49
|
-
private promise;
|
|
50
|
-
private readonly completed;
|
|
51
|
-
private complete;
|
|
52
|
-
private interval;
|
|
53
|
-
/**
|
|
54
|
-
* Creates a Durable Promise instance. This is provided as a lower level API, used by the Resonate class internally.
|
|
55
|
-
*
|
|
56
|
-
* @constructor
|
|
57
|
-
* @param store - A reference to a promise store.
|
|
58
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
59
|
-
* @param promise - The raw Durable Promise.
|
|
60
|
-
*/
|
|
61
|
-
constructor(store: IPromiseStore, encoder: IEncoder<unknown, string | undefined>, promise: DurablePromiseRecord);
|
|
62
|
-
/**
|
|
63
|
-
* The Durable Promise id.
|
|
64
|
-
*/
|
|
65
|
-
get id(): string;
|
|
66
|
-
/**
|
|
67
|
-
* The Durable Promise create idempotency key.
|
|
68
|
-
*/
|
|
69
|
-
get idempotencyKeyForCreate(): string | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* The Durable Promise complete idempotency key.
|
|
72
|
-
*/
|
|
73
|
-
get idempotencyKeyForComplete(): string | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* The Durable Promise created on time.
|
|
76
|
-
*/
|
|
77
|
-
get createdOn(): number;
|
|
78
|
-
/**
|
|
79
|
-
* The Durable Promise timeout time.
|
|
80
|
-
*/
|
|
81
|
-
get timeout(): number;
|
|
82
|
-
/**
|
|
83
|
-
* Returns true when the Durable Promise is pending.
|
|
84
|
-
*/
|
|
85
|
-
get pending(): boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Returns true when the Durable Promise is resolved.
|
|
88
|
-
*/
|
|
89
|
-
get resolved(): boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Returns true when the Durable Promise is rejected.
|
|
92
|
-
*/
|
|
93
|
-
get rejected(): boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Returns true when the Durable Promise is canceled.
|
|
96
|
-
*/
|
|
97
|
-
get canceled(): boolean;
|
|
98
|
-
/**
|
|
99
|
-
* Returns true when the Durable Promise is timedout.
|
|
100
|
-
*/
|
|
101
|
-
get timedout(): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Returns the decoded promise param data.
|
|
104
|
-
*/
|
|
105
|
-
param(): unknown;
|
|
106
|
-
/**
|
|
107
|
-
* Returns the decoded promise value data.
|
|
108
|
-
*/
|
|
109
|
-
value(): T;
|
|
110
|
-
/**
|
|
111
|
-
* Returns the decoded promise value data as an error.
|
|
112
|
-
*/
|
|
113
|
-
error(): unknown;
|
|
114
|
-
/**
|
|
115
|
-
* Creates a Durable Promise.
|
|
116
|
-
* @param store - A reference to a promise store.
|
|
117
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
118
|
-
* @param id - The Durable Promise id.
|
|
119
|
-
* @param timeout - The Durable Promise timeout in milliseconds.
|
|
120
|
-
* @param opts - A partial Durable Promise create options.
|
|
121
|
-
* @returns A Durable Promise instance.
|
|
122
|
-
*/
|
|
123
|
-
static create<T>(store: IPromiseStore, encoder: IEncoder<unknown, string | undefined>, id: string, timeout: number, opts?: Partial<CreateOptions>): Promise<DurablePromise<T>>;
|
|
124
|
-
/**
|
|
125
|
-
* Resolves a Durable Promise.
|
|
126
|
-
* @param store - A reference to a promise store.
|
|
127
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
128
|
-
* @param id - The Durable Promise id.
|
|
129
|
-
* @param value - The Durable Promise value, will be encoded with the provided encoder.
|
|
130
|
-
* @param opts - A partial Durable Promise create options.
|
|
131
|
-
* @returns A Durable Promise instance.
|
|
132
|
-
*/
|
|
133
|
-
static resolve<T>(store: IPromiseStore, encoder: IEncoder<unknown, string | undefined>, id: string, value: T, opts?: Partial<CompleteOptions>): Promise<DurablePromise<T>>;
|
|
134
|
-
/**
|
|
135
|
-
* Rejects a Durable Promise.
|
|
136
|
-
* @param store - A reference to a promise store.
|
|
137
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
138
|
-
* @param id - The Durable Promise id.
|
|
139
|
-
* @param error - The Durable Promise error value, will be encoded with the provided encoder.
|
|
140
|
-
* @param opts - A partial Durable Promise create options.
|
|
141
|
-
* @returns A Durable Promise instance.
|
|
142
|
-
*/
|
|
143
|
-
static reject<T>(store: IPromiseStore, encoder: IEncoder<unknown, string | undefined>, id: string, error: any, opts?: Partial<CompleteOptions>): Promise<DurablePromise<T>>;
|
|
144
|
-
/**
|
|
145
|
-
* Cancels a Durable Promise.
|
|
146
|
-
* @param store - A reference to a promise store.
|
|
147
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
148
|
-
* @param id - The Durable Promise id.
|
|
149
|
-
* @param error - The Durable Promise error value, will be encoded with the provided encoder.
|
|
150
|
-
* @param opts - A partial Durable Promise create options.
|
|
151
|
-
* @returns A Durable Promise instance.
|
|
152
|
-
*/
|
|
153
|
-
static cancel<T>(store: IPromiseStore, encoder: IEncoder<unknown, string | undefined>, id: string, error: any, opts?: Partial<CompleteOptions>): Promise<DurablePromise<T>>;
|
|
154
|
-
/**
|
|
155
|
-
* Gets a Durable Promise.
|
|
156
|
-
* @param store - A reference to a promise store.
|
|
157
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
158
|
-
* @param id - The Durable Promise id.
|
|
159
|
-
* @returns A Durable Promise instance.
|
|
160
|
-
*/
|
|
161
|
-
static get<T>(store: IPromiseStore, encoder: IEncoder<unknown, string | undefined>, id: string): Promise<DurablePromise<T>>;
|
|
162
|
-
/**
|
|
163
|
-
* Search for Durable Promises.
|
|
164
|
-
* @param store - A reference to a promise store.
|
|
165
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
166
|
-
* @param id - An id to match against Durable Promise ids, can include wilcards.
|
|
167
|
-
* @param state - A state to search for, can be one of {pending, resolved, rejected}, matches all states if undefined.
|
|
168
|
-
* @param tags - Tags to search against.
|
|
169
|
-
* @param limit - The maximum number of Durable Promises to return per page.
|
|
170
|
-
* @returns An async generator that yields Durable Promise instances.
|
|
171
|
-
*/
|
|
172
|
-
static search(store: IPromiseStore, encoder: IEncoder<unknown, string | undefined>, id: string, state?: string, tags?: Record<string, string>, limit?: number): AsyncGenerator<DurablePromise<any>[], void>;
|
|
173
|
-
/**
|
|
174
|
-
* Resolves the Durable Promise.
|
|
175
|
-
* @param value - The Durable Promise value, will be encoded with the provided encoder.
|
|
176
|
-
* @param opts - A partial Durable Promise create options.
|
|
177
|
-
* @returns this instance.
|
|
178
|
-
*/
|
|
179
|
-
resolve(value: T, opts?: Partial<CompleteOptions>): Promise<this>;
|
|
180
|
-
/**
|
|
181
|
-
* Rejects the Durable Promise.
|
|
182
|
-
* @param error - The Durable Promise error value, will be encoded with the provided encoder.
|
|
183
|
-
* @param opts - A partial Durable Promise create options.
|
|
184
|
-
* @returns this instance.
|
|
185
|
-
*/
|
|
186
|
-
reject(error: any, opts?: Partial<CompleteOptions>): Promise<this>;
|
|
187
|
-
/**
|
|
188
|
-
* Cancels the Durable Promise.
|
|
189
|
-
* @param error - The Durable Promise error value, will be encoded with the provided encoder.
|
|
190
|
-
* @param opts - A partial Durable Promise create options.
|
|
191
|
-
* @returns this instance.
|
|
192
|
-
*/
|
|
193
|
-
cancel(error: any, opts?: Partial<CompleteOptions>): Promise<this>;
|
|
194
|
-
/**
|
|
195
|
-
* Polls the Durable Promise store to sychronize the state, stops when the promise is complete.
|
|
196
|
-
* @param timeout - The time at which to stop polling if the promise is still pending.
|
|
197
|
-
* @param frequency - The frequency in ms to poll.
|
|
198
|
-
* @returns A Promise that resolves when the Durable Promise is complete.
|
|
199
|
-
*/
|
|
200
|
-
sync(timeout?: number, frequency?: number): Promise<void>;
|
|
201
|
-
/**
|
|
202
|
-
* Polls the Durable Promise store, and returns the value when the Durable Promise is complete.
|
|
203
|
-
* @param timeout - The time at which to stop polling if the promise is still pending.
|
|
204
|
-
* @param frequency - The frequency in ms to poll.
|
|
205
|
-
* @returns The promise value, or throws an error.
|
|
206
|
-
*/
|
|
207
|
-
wait(timeout?: number, frequency?: number): Promise<T>;
|
|
208
|
-
private poll;
|
|
209
|
-
}
|
|
210
|
-
//# sourceMappingURL=promises.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promises.d.ts","sourceRoot":"","sources":["../../../lib/core/promises/promises.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,qBAAa,cAAc,CAAC,CAAC;IAczB,OAAO,CAAC,KAA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B5D;;;;;OAKG;IACG,IAAI,CAAC,OAAO,GAAE,MAAiB,EAAE,SAAS,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC/E;;;;;OAKG;IACG,IAAI,CAAC,OAAO,GAAE,MAAiB,EAAE,SAAS,GAAE,MAAa,GAAG,OAAO,CAAC,CAAC,CAAC;YAU9D,IAAI;CAWnB"}
|
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DurablePromise = void 0;
|
|
4
|
-
const errors_1 = require("../errors");
|
|
5
|
-
class DurablePromise {
|
|
6
|
-
store;
|
|
7
|
-
encoder;
|
|
8
|
-
promise;
|
|
9
|
-
completed;
|
|
10
|
-
complete;
|
|
11
|
-
interval;
|
|
12
|
-
/**
|
|
13
|
-
* Creates a Durable Promise instance. This is provided as a lower level API, used by the Resonate class internally.
|
|
14
|
-
*
|
|
15
|
-
* @constructor
|
|
16
|
-
* @param store - A reference to a promise store.
|
|
17
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
18
|
-
* @param promise - The raw Durable Promise.
|
|
19
|
-
*/
|
|
20
|
-
constructor(store, encoder, promise) {
|
|
21
|
-
this.store = store;
|
|
22
|
-
this.encoder = encoder;
|
|
23
|
-
this.promise = promise;
|
|
24
|
-
this.completed = new Promise((resolve) => {
|
|
25
|
-
this.complete = resolve;
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* The Durable Promise id.
|
|
30
|
-
*/
|
|
31
|
-
get id() {
|
|
32
|
-
return this.promise.id;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* The Durable Promise create idempotency key.
|
|
36
|
-
*/
|
|
37
|
-
get idempotencyKeyForCreate() {
|
|
38
|
-
return this.promise.idempotencyKeyForCreate;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* The Durable Promise complete idempotency key.
|
|
42
|
-
*/
|
|
43
|
-
get idempotencyKeyForComplete() {
|
|
44
|
-
return this.promise.idempotencyKeyForComplete;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* The Durable Promise created on time.
|
|
48
|
-
*/
|
|
49
|
-
get createdOn() {
|
|
50
|
-
return this.promise.createdOn;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* The Durable Promise timeout time.
|
|
54
|
-
*/
|
|
55
|
-
get timeout() {
|
|
56
|
-
return this.promise.timeout;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Returns true when the Durable Promise is pending.
|
|
60
|
-
*/
|
|
61
|
-
get pending() {
|
|
62
|
-
return this.promise.state === "PENDING";
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Returns true when the Durable Promise is resolved.
|
|
66
|
-
*/
|
|
67
|
-
get resolved() {
|
|
68
|
-
return this.promise.state === "RESOLVED";
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Returns true when the Durable Promise is rejected.
|
|
72
|
-
*/
|
|
73
|
-
get rejected() {
|
|
74
|
-
return this.promise.state === "REJECTED";
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Returns true when the Durable Promise is canceled.
|
|
78
|
-
*/
|
|
79
|
-
get canceled() {
|
|
80
|
-
return this.promise.state === "REJECTED_CANCELED";
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Returns true when the Durable Promise is timedout.
|
|
84
|
-
*/
|
|
85
|
-
get timedout() {
|
|
86
|
-
return this.promise.state === "REJECTED_TIMEDOUT";
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Returns the decoded promise param data.
|
|
90
|
-
*/
|
|
91
|
-
param() {
|
|
92
|
-
return this.encoder.decode(this.promise.param.data);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Returns the decoded promise value data.
|
|
96
|
-
*/
|
|
97
|
-
value() {
|
|
98
|
-
if (!this.resolved) {
|
|
99
|
-
throw new Error("Promise is not resolved");
|
|
100
|
-
}
|
|
101
|
-
return this.encoder.decode(this.promise.value.data);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Returns the decoded promise value data as an error.
|
|
105
|
-
*/
|
|
106
|
-
error() {
|
|
107
|
-
if (this.rejected) {
|
|
108
|
-
return this.encoder.decode(this.promise.value.data);
|
|
109
|
-
}
|
|
110
|
-
else if (this.canceled) {
|
|
111
|
-
return new errors_1.ResonateError("Resonate function canceled", errors_1.ErrorCodes.CANCELED, this.encoder.decode(this.promise.value.data));
|
|
112
|
-
}
|
|
113
|
-
else if (this.timedout) {
|
|
114
|
-
return new errors_1.ResonateError(`Resonate function timedout at ${new Date(this.promise.timeout).toISOString()}`, errors_1.ErrorCodes.TIMEDOUT);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
throw new Error("Promise is not rejected, canceled, or timedout");
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Creates a Durable Promise.
|
|
122
|
-
* @param store - A reference to a promise store.
|
|
123
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
124
|
-
* @param id - The Durable Promise id.
|
|
125
|
-
* @param timeout - The Durable Promise timeout in milliseconds.
|
|
126
|
-
* @param opts - A partial Durable Promise create options.
|
|
127
|
-
* @returns A Durable Promise instance.
|
|
128
|
-
*/
|
|
129
|
-
static async create(store, encoder, id, timeout, opts = {}) {
|
|
130
|
-
const storedPromise = await store.create(id, opts.idempotencyKey, opts.strict ?? false, opts.headers, encoder.encode(opts.param), timeout, opts.tags);
|
|
131
|
-
return new DurablePromise(store, encoder, storedPromise);
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Resolves a Durable Promise.
|
|
135
|
-
* @param store - A reference to a promise store.
|
|
136
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
137
|
-
* @param id - The Durable Promise id.
|
|
138
|
-
* @param value - The Durable Promise value, will be encoded with the provided encoder.
|
|
139
|
-
* @param opts - A partial Durable Promise create options.
|
|
140
|
-
* @returns A Durable Promise instance.
|
|
141
|
-
*/
|
|
142
|
-
static async resolve(store, encoder, id, value, opts = {}) {
|
|
143
|
-
return new DurablePromise(store, encoder, await store.resolve(id, opts.idempotencyKey, opts.strict ?? false, opts.headers, encoder.encode(value)));
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Rejects a Durable Promise.
|
|
147
|
-
* @param store - A reference to a promise store.
|
|
148
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
149
|
-
* @param id - The Durable Promise id.
|
|
150
|
-
* @param error - The Durable Promise error value, will be encoded with the provided encoder.
|
|
151
|
-
* @param opts - A partial Durable Promise create options.
|
|
152
|
-
* @returns A Durable Promise instance.
|
|
153
|
-
*/
|
|
154
|
-
static async reject(store, encoder, id, error, opts = {}) {
|
|
155
|
-
return new DurablePromise(store, encoder, await store.reject(id, opts.idempotencyKey, opts.strict ?? false, opts.headers, encoder.encode(error)));
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Cancels a Durable Promise.
|
|
159
|
-
* @param store - A reference to a promise store.
|
|
160
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
161
|
-
* @param id - The Durable Promise id.
|
|
162
|
-
* @param error - The Durable Promise error value, will be encoded with the provided encoder.
|
|
163
|
-
* @param opts - A partial Durable Promise create options.
|
|
164
|
-
* @returns A Durable Promise instance.
|
|
165
|
-
*/
|
|
166
|
-
static async cancel(store, encoder, id, error, opts = {}) {
|
|
167
|
-
return new DurablePromise(store, encoder, await store.cancel(id, opts.idempotencyKey, opts.strict ?? false, opts.headers, encoder.encode(error)));
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Gets a Durable Promise.
|
|
171
|
-
* @param store - A reference to a promise store.
|
|
172
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
173
|
-
* @param id - The Durable Promise id.
|
|
174
|
-
* @returns A Durable Promise instance.
|
|
175
|
-
*/
|
|
176
|
-
static async get(store, encoder, id) {
|
|
177
|
-
return new DurablePromise(store, encoder, await store.get(id));
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Search for Durable Promises.
|
|
181
|
-
* @param store - A reference to a promise store.
|
|
182
|
-
* @param encoder - An encoder instance used for encode and decode promise data.
|
|
183
|
-
* @param id - An id to match against Durable Promise ids, can include wilcards.
|
|
184
|
-
* @param state - A state to search for, can be one of {pending, resolved, rejected}, matches all states if undefined.
|
|
185
|
-
* @param tags - Tags to search against.
|
|
186
|
-
* @param limit - The maximum number of Durable Promises to return per page.
|
|
187
|
-
* @returns An async generator that yields Durable Promise instances.
|
|
188
|
-
*/
|
|
189
|
-
static async *search(store, encoder, id, state, tags, limit) {
|
|
190
|
-
for await (const promises of store.search(id, state, tags, limit)) {
|
|
191
|
-
yield promises.map((p) => new DurablePromise(store, encoder, p));
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Resolves the Durable Promise.
|
|
196
|
-
* @param value - The Durable Promise value, will be encoded with the provided encoder.
|
|
197
|
-
* @param opts - A partial Durable Promise create options.
|
|
198
|
-
* @returns this instance.
|
|
199
|
-
*/
|
|
200
|
-
async resolve(value, opts = {}) {
|
|
201
|
-
this.promise = !this.pending
|
|
202
|
-
? this.promise
|
|
203
|
-
: await this.store.resolve(this.id, opts.idempotencyKey, opts.strict ?? false, opts.headers, this.encoder.encode(value));
|
|
204
|
-
if (!this.pending) {
|
|
205
|
-
this.complete(this);
|
|
206
|
-
}
|
|
207
|
-
return this;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Rejects the Durable Promise.
|
|
211
|
-
* @param error - The Durable Promise error value, will be encoded with the provided encoder.
|
|
212
|
-
* @param opts - A partial Durable Promise create options.
|
|
213
|
-
* @returns this instance.
|
|
214
|
-
*/
|
|
215
|
-
async reject(error, opts = {}) {
|
|
216
|
-
this.promise = !this.pending
|
|
217
|
-
? this.promise
|
|
218
|
-
: await this.store.reject(this.id, opts.idempotencyKey, opts.strict ?? false, opts.headers, this.encoder.encode(error));
|
|
219
|
-
if (!this.pending) {
|
|
220
|
-
this.complete(this);
|
|
221
|
-
}
|
|
222
|
-
return this;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Cancels the Durable Promise.
|
|
226
|
-
* @param error - The Durable Promise error value, will be encoded with the provided encoder.
|
|
227
|
-
* @param opts - A partial Durable Promise create options.
|
|
228
|
-
* @returns this instance.
|
|
229
|
-
*/
|
|
230
|
-
async cancel(error, opts = {}) {
|
|
231
|
-
this.promise = !this.pending
|
|
232
|
-
? this.promise
|
|
233
|
-
: await this.store.cancel(this.id, opts.idempotencyKey, opts.strict ?? false, opts.headers, this.encoder.encode(error));
|
|
234
|
-
if (!this.pending) {
|
|
235
|
-
this.complete(this);
|
|
236
|
-
}
|
|
237
|
-
return this;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Polls the Durable Promise store to sychronize the state, stops when the promise is complete.
|
|
241
|
-
* @param timeout - The time at which to stop polling if the promise is still pending.
|
|
242
|
-
* @param frequency - The frequency in ms to poll.
|
|
243
|
-
* @returns A Promise that resolves when the Durable Promise is complete.
|
|
244
|
-
*/
|
|
245
|
-
async sync(timeout = Infinity, frequency = 5000) {
|
|
246
|
-
if (!this.pending)
|
|
247
|
-
return;
|
|
248
|
-
// reset polling interval
|
|
249
|
-
clearInterval(this.interval);
|
|
250
|
-
this.interval = setInterval(() => this.poll(), frequency);
|
|
251
|
-
// poll immediately for now
|
|
252
|
-
// we can revisit when we implement a cache subsystem
|
|
253
|
-
await this.poll();
|
|
254
|
-
// set timeout promise
|
|
255
|
-
let timeoutId;
|
|
256
|
-
const timeoutPromise = timeout === Infinity
|
|
257
|
-
? new Promise(() => { }) // wait forever
|
|
258
|
-
: new Promise((resolve) => (timeoutId = setTimeout(resolve, timeout)));
|
|
259
|
-
// await either:
|
|
260
|
-
// - completion of the promise
|
|
261
|
-
// - timeout
|
|
262
|
-
await Promise.race([this.completed, timeoutPromise]);
|
|
263
|
-
// clear polling interval
|
|
264
|
-
clearInterval(this.interval);
|
|
265
|
-
// clear timeout
|
|
266
|
-
clearTimeout(timeoutId);
|
|
267
|
-
// throw error if timeout occcured
|
|
268
|
-
if (this.pending) {
|
|
269
|
-
throw new Error("Timeout occured while waiting for promise to complete");
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Polls the Durable Promise store, and returns the value when the Durable Promise is complete.
|
|
274
|
-
* @param timeout - The time at which to stop polling if the promise is still pending.
|
|
275
|
-
* @param frequency - The frequency in ms to poll.
|
|
276
|
-
* @returns The promise value, or throws an error.
|
|
277
|
-
*/
|
|
278
|
-
async wait(timeout = Infinity, frequency = 5000) {
|
|
279
|
-
await this.sync(timeout, frequency);
|
|
280
|
-
if (this.resolved) {
|
|
281
|
-
return this.value();
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
throw this.error();
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
async poll() {
|
|
288
|
-
try {
|
|
289
|
-
this.promise = await this.store.get(this.id);
|
|
290
|
-
if (!this.pending) {
|
|
291
|
-
this.complete(this);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
catch (e) {
|
|
295
|
-
// TODO: log
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
exports.DurablePromise = DurablePromise;
|
|
300
|
-
//# sourceMappingURL=promises.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promises.js","sourceRoot":"","sources":["../../../lib/core/promises/promises.ts"],"names":[],"mappings":";;;AACA,sCAAsD;AAsDtD,MAAa,cAAc;IAcf;IACA;IACA;IAfO,SAAS,CAA6B;IAC/C,QAAQ,CAAsC;IAC9C,QAAQ,CAA6B;IAE7C;;;;;;;OAOG;IACH,YACU,KAAoB,EACpB,OAA8C,EAC9C,OAA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AC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,IAAI;QAChB,IAAI,CAAC;YACH,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAE7C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,YAAY;QACd,CAAC;IACH,CAAC;CACF;AApZD,wCAoZC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { IEncoder } from "../encoder";
|
|
2
|
-
export type DurablePromiseRecord = {
|
|
3
|
-
state: "PENDING" | "RESOLVED" | "REJECTED" | "REJECTED_CANCELED" | "REJECTED_TIMEDOUT";
|
|
4
|
-
id: string;
|
|
5
|
-
timeout: number;
|
|
6
|
-
param: {
|
|
7
|
-
headers: Record<string, string> | undefined;
|
|
8
|
-
data: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
value: {
|
|
11
|
-
headers: Record<string, string> | undefined;
|
|
12
|
-
data: string | undefined;
|
|
13
|
-
};
|
|
14
|
-
createdOn: number;
|
|
15
|
-
completedOn: number | undefined;
|
|
16
|
-
idempotencyKeyForCreate: string | undefined;
|
|
17
|
-
idempotencyKeyForComplete: string | undefined;
|
|
18
|
-
tags: Record<string, string> | undefined;
|
|
19
|
-
};
|
|
20
|
-
export declare function isDurablePromiseRecord(p: unknown): p is DurablePromiseRecord;
|
|
21
|
-
export declare function isPendingPromise(p: DurablePromiseRecord): boolean;
|
|
22
|
-
export declare function isResolvedPromise(p: DurablePromiseRecord): boolean;
|
|
23
|
-
export declare function isRejectedPromise(p: DurablePromiseRecord): boolean;
|
|
24
|
-
export declare function isCanceledPromise(p: DurablePromiseRecord): boolean;
|
|
25
|
-
export declare function isTimedoutPromise(p: DurablePromiseRecord): boolean;
|
|
26
|
-
export declare function isCompletedPromise(p: DurablePromiseRecord): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Handles a completed durable promise and returns its result.
|
|
29
|
-
*
|
|
30
|
-
* @param p - The DurablePromiseRecord to handle.
|
|
31
|
-
* @param encoder - An IEncoder instance used to decode the promise's data.
|
|
32
|
-
* @returns The decoded result of the promise if resolved, or null if pending.
|
|
33
|
-
* @throws {ResonateError} If the promise was rejected, canceled, or timed out.
|
|
34
|
-
*
|
|
35
|
-
* @remarks
|
|
36
|
-
* Users must handle the null return case, which could indicate either:
|
|
37
|
-
* 1. The promise is still pending, or
|
|
38
|
-
* 2. The promise completed with a null value.
|
|
39
|
-
* It's important to distinguish between these cases in the calling code if necessary.
|
|
40
|
-
*/
|
|
41
|
-
export declare function handleCompletedPromise<R>(p: DurablePromiseRecord, encoder: IEncoder<unknown, string | undefined>): R;
|
|
42
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/core/promises/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;IACvF,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;QAC5C,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B,CAAC;IACF,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;QAC5C,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,uBAAuB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,yBAAyB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CAC1C,CAAC;AAGF,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,oBAAoB,CAQ5E;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAEjE;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAElE;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAElE;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAElE;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAElE;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAEnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,oBAAoB,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAepH"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.handleCompletedPromise = exports.isCompletedPromise = exports.isTimedoutPromise = exports.isCanceledPromise = exports.isRejectedPromise = exports.isResolvedPromise = exports.isPendingPromise = exports.isDurablePromiseRecord = void 0;
|
|
7
|
-
const assert_1 = __importDefault(require("assert"));
|
|
8
|
-
const errors_1 = require("../errors");
|
|
9
|
-
// This is an unsound type guard, we should be more strict in what we call a DurablePromise
|
|
10
|
-
function isDurablePromiseRecord(p) {
|
|
11
|
-
return (p !== null &&
|
|
12
|
-
typeof p === "object" &&
|
|
13
|
-
"state" in p &&
|
|
14
|
-
typeof p.state === "string" &&
|
|
15
|
-
["PENDING", "RESOLVED", "REJECTED", "REJECTED_CANCELED", "REJECTED_TIMEDOUT"].includes(p.state));
|
|
16
|
-
}
|
|
17
|
-
exports.isDurablePromiseRecord = isDurablePromiseRecord;
|
|
18
|
-
function isPendingPromise(p) {
|
|
19
|
-
return p.state === "PENDING";
|
|
20
|
-
}
|
|
21
|
-
exports.isPendingPromise = isPendingPromise;
|
|
22
|
-
function isResolvedPromise(p) {
|
|
23
|
-
return p.state === "RESOLVED";
|
|
24
|
-
}
|
|
25
|
-
exports.isResolvedPromise = isResolvedPromise;
|
|
26
|
-
function isRejectedPromise(p) {
|
|
27
|
-
return p.state === "REJECTED";
|
|
28
|
-
}
|
|
29
|
-
exports.isRejectedPromise = isRejectedPromise;
|
|
30
|
-
function isCanceledPromise(p) {
|
|
31
|
-
return p.state === "REJECTED_CANCELED";
|
|
32
|
-
}
|
|
33
|
-
exports.isCanceledPromise = isCanceledPromise;
|
|
34
|
-
function isTimedoutPromise(p) {
|
|
35
|
-
return p.state === "REJECTED_TIMEDOUT";
|
|
36
|
-
}
|
|
37
|
-
exports.isTimedoutPromise = isTimedoutPromise;
|
|
38
|
-
function isCompletedPromise(p) {
|
|
39
|
-
return ["RESOLVED", "REJECTED", "REJECTED_CANCELED", "REJECTED_TIMEDOUT"].includes(p.state);
|
|
40
|
-
}
|
|
41
|
-
exports.isCompletedPromise = isCompletedPromise;
|
|
42
|
-
/**
|
|
43
|
-
* Handles a completed durable promise and returns its result.
|
|
44
|
-
*
|
|
45
|
-
* @param p - The DurablePromiseRecord to handle.
|
|
46
|
-
* @param encoder - An IEncoder instance used to decode the promise's data.
|
|
47
|
-
* @returns The decoded result of the promise if resolved, or null if pending.
|
|
48
|
-
* @throws {ResonateError} If the promise was rejected, canceled, or timed out.
|
|
49
|
-
*
|
|
50
|
-
* @remarks
|
|
51
|
-
* Users must handle the null return case, which could indicate either:
|
|
52
|
-
* 1. The promise is still pending, or
|
|
53
|
-
* 2. The promise completed with a null value.
|
|
54
|
-
* It's important to distinguish between these cases in the calling code if necessary.
|
|
55
|
-
*/
|
|
56
|
-
function handleCompletedPromise(p, encoder) {
|
|
57
|
-
(0, assert_1.default)(p.state !== "PENDING", "Promise was pending when trying to handle its completion");
|
|
58
|
-
switch (p.state) {
|
|
59
|
-
case "RESOLVED":
|
|
60
|
-
return encoder.decode(p.value.data);
|
|
61
|
-
case "REJECTED":
|
|
62
|
-
throw encoder.decode(p.value.data);
|
|
63
|
-
case "REJECTED_CANCELED":
|
|
64
|
-
throw new errors_1.ResonateError("Resonate function canceled", errors_1.ErrorCodes.CANCELED, encoder.decode(p.value.data));
|
|
65
|
-
case "REJECTED_TIMEDOUT":
|
|
66
|
-
throw new errors_1.ResonateError(`Resonate function timedout at ${new Date(p.timeout).toISOString()}`, errors_1.ErrorCodes.TIMEDOUT);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.handleCompletedPromise = handleCompletedPromise;
|
|
70
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/core/promises/types.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,sCAAsD;AAqBtD,2FAA2F;AAC3F,SAAgB,sBAAsB,CAAC,CAAU;IAC/C,OAAO,CACL,CAAC,KAAK,IAAI;QACV,OAAO,CAAC,KAAK,QAAQ;QACrB,OAAO,IAAI,CAAC;QACZ,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ;QAC3B,CAAC,SAAS,EAAE,UAAU,EAAE,U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