exupery-core-async 0.1.27 → 0.1.29
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _et from 'exupery-core-types';
|
|
2
2
|
import { Guaranteed_Procedure_Context } from "./Guaranteed_Procedure_Context";
|
|
3
|
+
import { Unguaranteed_Query_Result } from './Unguaranteed_Query_Result';
|
|
3
4
|
export interface Unguaranteed_Procedure_Context<E> {
|
|
4
5
|
/**
|
|
5
6
|
*
|
|
@@ -14,10 +15,12 @@ export interface Unguaranteed_Procedure_Context<E> {
|
|
|
14
15
|
* which would switch to the guaranteed context
|
|
15
16
|
*/
|
|
16
17
|
process_exception_deprecated<NE>(handle: ($i: Guaranteed_Procedure_Context, $: E) => Guaranteed_Procedure_Context, map: ($: E) => NE): Unguaranteed_Procedure_Context<NE>;
|
|
18
|
+
process_unguaranteed_data<T, NE>(get_data: () => Unguaranteed_Query_Result<T, NE>, handle_exception: ($i: Guaranteed_Procedure_Context, $: NE) => Guaranteed_Procedure_Context, map_exception: ($: NE) => E, handle_data: ($i: Unguaranteed_Procedure_Context<E>, $: T) => Unguaranteed_Procedure_Context<E>): Unguaranteed_Procedure_Context<E>;
|
|
17
19
|
throw_exception<E>($: E): Unguaranteed_Procedure_Context<E>;
|
|
18
20
|
catch(handle_exception: ($i: Guaranteed_Procedure_Context, $: E) => Guaranteed_Procedure_Context): Guaranteed_Procedure_Context;
|
|
19
|
-
execute_unguaranteed(
|
|
20
|
-
|
|
21
|
+
execute_unguaranteed(executer: ($i: Unguaranteed_Procedure_Context<E>) => Unguaranteed_Procedure_Context<E>): Unguaranteed_Procedure_Context<E>;
|
|
22
|
+
execute_foreign<NE>(executer: ($i: Unguaranteed_Procedure_Context<NE>) => Unguaranteed_Procedure_Context<NE>, handle_exception: ($i: Guaranteed_Procedure_Context, $: NE) => Guaranteed_Procedure_Context, map: ($: NE) => E): Unguaranteed_Procedure_Context<E>;
|
|
23
|
+
execute(executer: ($i: Guaranteed_Procedure_Context) => Guaranteed_Procedure_Context): Unguaranteed_Procedure_Context<E>;
|
|
21
24
|
execute_dictionary_unguaranteed<E2>($: _et.Dictionary<Unguaranteed_Procedure_Context<E2>>, aggregate_exceptions: ($: _et.Dictionary<E2>) => E): Unguaranteed_Procedure_Context<E>;
|
|
22
25
|
execute_multiple_unguaranteed<E2>($: _et.Array<Unguaranteed_Procedure_Context<E2>>, aggregate_exceptions: ($: _et.Array<E2>) => E): Unguaranteed_Procedure_Context<E>;
|
|
23
26
|
__start(on_success: () => void, on_exception: ($: E) => void): void;
|
|
@@ -32,6 +32,9 @@ class Unguaranteed_Command_Result_Class {
|
|
|
32
32
|
constructor(executer) {
|
|
33
33
|
this.executer = executer;
|
|
34
34
|
}
|
|
35
|
+
process_unguaranteed_data(get_data, handle_exception, map_exception, handle_data) {
|
|
36
|
+
return get_data().process(handle_exception, map_exception, handle_data);
|
|
37
|
+
}
|
|
35
38
|
process_exception_deprecated(handle, map) {
|
|
36
39
|
return new Unguaranteed_Command_Result_Class({
|
|
37
40
|
'execute': (new_on_success, new_on_exception) => {
|
|
@@ -68,6 +71,19 @@ class Unguaranteed_Command_Result_Class {
|
|
|
68
71
|
}
|
|
69
72
|
});
|
|
70
73
|
}
|
|
74
|
+
execute_foreign(executer, handle_exception, map_exception) {
|
|
75
|
+
return new Unguaranteed_Command_Result_Class({
|
|
76
|
+
'execute': (new_on_success, new_on_exception) => {
|
|
77
|
+
this.executer.execute(() => {
|
|
78
|
+
executer((0, exports.initialize_unguaranteed_procedure_context)()).__start(new_on_success, ($) => {
|
|
79
|
+
handle_exception((0, initialize_guaranteed_procedure_context_1.initialize_guaranteed_procedure_context)(), $).__start(() => {
|
|
80
|
+
new_on_exception(map_exception($));
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}, new_on_exception);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
71
87
|
execute(handle) {
|
|
72
88
|
return new Unguaranteed_Command_Result_Class({
|
|
73
89
|
'execute': (new_on_success, new_on_exception) => {
|