ballerina-core 1.0.244 → 1.0.245
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/bin/src/async/domains/mirroring/domains/synchronization-result/state.d.ts +7 -0
- package/bin/src/async/domains/mirroring/domains/synchronization-result/state.d.ts.map +1 -1
- package/bin/src/queue/state.d.ts +2 -2
- package/bin/src/queue/state.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/queue/state.ts +8 -4
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
export type SynchronizationResult = "completed" | "should be enqueued again" | "permanent error";
|
|
2
|
+
export type SynchronizationOperationResult = {
|
|
3
|
+
kind: "completed";
|
|
4
|
+
} | {
|
|
5
|
+
kind: "should be enqueued again";
|
|
6
|
+
} | {
|
|
7
|
+
kind: "permanent error";
|
|
8
|
+
};
|
|
2
9
|
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../../../src/async/domains/mirroring/domains/synchronization-result/state.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,0BAA0B,GAC1B,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../../../src/async/domains/mirroring/domains/synchronization-result/state.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,0BAA0B,GAC1B,iBAAiB,CAAC;AAEtB,MAAM,MAAM,8BAA8B,GACtC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,0BAA0B,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC"}
|
package/bin/src/queue/state.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OrderedMap } from "immutable";
|
|
2
|
-
import { Guid, Unit,
|
|
2
|
+
import { Guid, Unit, SynchronizationOperationResult } from "../../main";
|
|
3
3
|
import { Coroutine } from "../coroutines/state";
|
|
4
4
|
import { BasicFun } from "../fun/state";
|
|
5
|
-
export declare const QueueCoroutine: <Context, State, OperationResult =
|
|
5
|
+
export declare const QueueCoroutine: <Context, State, OperationResult = SynchronizationOperationResult>(removeItem: BasicFun<Guid, Coroutine<Context & State, State, Unit>>, getItemsToProcess: BasicFun<Context & State, OrderedMap<Guid, {
|
|
6
6
|
preprocess: Coroutine<Context & State, State, Unit>;
|
|
7
7
|
operation: Coroutine<Context & State, State, OperationResult>;
|
|
8
8
|
postprocess: BasicFun<OperationResult, Coroutine<Context & State, State, Unit>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/queue/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/queue/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,eAAO,MAAM,cAAc,GACzB,OAAO,EACP,KAAK,EACL,eAAe,GAAG,8BAA8B,EAEhD,YAAY,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,GAAG,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,EACnE,mBAAmB,QAAQ,CACzB,OAAO,GAAG,KAAK,EACf,UAAU,CACR,IAAI,EACJ;IACE,UAAU,EAAE,SAAS,CAAC,OAAO,GAAG,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACpD,SAAS,EAAE,SAAS,CAAC,OAAO,GAAG,KAAK,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;IAC9D,WAAW,EAAE,QAAQ,CACnB,eAAe,EACf,SAAS,CAAC,OAAO,GAAG,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CACxC,CAAC;IACF,SAAS,EAAE,SAAS,CAAC,OAAO,GAAG,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;CACpD,CACF,CACF,KACA,SAAS,CAAC,OAAO,GAAG,KAAK,EAAE,KAAK,EAAE,IAAI,CA2BxC,CAAC"}
|
package/package.json
CHANGED
package/src/queue/state.ts
CHANGED
|
@@ -7,7 +7,8 @@ import { BasicFun } from "../fun/state";
|
|
|
7
7
|
export const QueueCoroutine = <
|
|
8
8
|
Context,
|
|
9
9
|
State,
|
|
10
|
-
OperationResult
|
|
10
|
+
OperationResult extends
|
|
11
|
+
SynchronizationOperationResult = SynchronizationOperationResult,
|
|
11
12
|
>(
|
|
12
13
|
removeItem: BasicFun<Guid, Coroutine<Context & State, State, Unit>>,
|
|
13
14
|
getItemsToProcess: BasicFun<
|
|
@@ -21,7 +22,10 @@ export const QueueCoroutine = <
|
|
|
21
22
|
OperationResult,
|
|
22
23
|
Coroutine<Context & State, State, Unit>
|
|
23
24
|
>;
|
|
24
|
-
reenqueue:
|
|
25
|
+
reenqueue: BasicFun<
|
|
26
|
+
OperationResult,
|
|
27
|
+
Coroutine<Context & State, State, Unit>
|
|
28
|
+
>;
|
|
25
29
|
}
|
|
26
30
|
>
|
|
27
31
|
>,
|
|
@@ -39,8 +43,8 @@ export const QueueCoroutine = <
|
|
|
39
43
|
.then(() => k.operation)
|
|
40
44
|
.then((_) =>
|
|
41
45
|
k.postprocess(_).then(() => {
|
|
42
|
-
if (_ == "should be enqueued again") {
|
|
43
|
-
return k.reenqueue;
|
|
46
|
+
if (_.kind == "should be enqueued again") {
|
|
47
|
+
return k.reenqueue(_);
|
|
44
48
|
} else {
|
|
45
49
|
return Co.Return({});
|
|
46
50
|
}
|