@@ -17,34 +17,45 @@ export enum LogLevel {
17
17
ERROR = 4 ,
18
18
}
19
19
export interface WasmFailure {
20
- code : number ;
21
- message : string ;
20
+ code : number ;
21
+ message : string ;
22
22
}
23
23
24
24
export interface WasmExponentialRetryConfig {
25
- initial_interval : number | undefined ;
26
- factor : number ;
27
- max_interval : number | undefined ;
28
- max_attempts : number | undefined ;
29
- max_duration : number | undefined ;
25
+ initial_interval : number | undefined ;
26
+ factor : number ;
27
+ max_interval : number | undefined ;
28
+ max_attempts : number | undefined ;
29
+ max_duration : number | undefined ;
30
30
}
31
31
32
32
export interface WasmAwakeable {
33
- id : string ;
34
- handle : number ;
33
+ id : string ;
34
+ handle : number ;
35
35
}
36
36
37
- export type WasmAsyncResultValue = "NotReady" | "Empty" | { Success : Uint8Array } | { Failure : WasmFailure } | { StateKeys : string [ ] } | { InvocationId : string } ;
37
+ export type WasmAsyncResultValue =
38
+ | "NotReady"
39
+ | "Empty"
40
+ | { Success : Uint8Array }
41
+ | { Failure : WasmFailure }
42
+ | { StateKeys : string [ ] }
43
+ | { InvocationId : string } ;
38
44
39
- export type WasmDoProgressResult = "AnyCompleted" | "ReadFromInput" | "WaitingPendingRun" | { ExecuteRun : number } | "CancelSignalReceived" ;
45
+ export type WasmDoProgressResult =
46
+ | "AnyCompleted"
47
+ | "ReadFromInput"
48
+ | "WaitingPendingRun"
49
+ | { ExecuteRun : number }
50
+ | "CancelSignalReceived" ;
40
51
41
52
export interface WasmCallHandle {
42
- invocation_id_completion_id : number ;
43
- call_completion_id : number ;
53
+ invocation_id_completion_id : number ;
54
+ call_completion_id : number ;
44
55
}
45
56
46
57
export interface WasmSendHandle {
47
- invocation_id_completion_id : number ;
58
+ invocation_id_completion_id : number ;
48
59
}
49
60
50
61
export class WasmHeader {
@@ -93,8 +104,21 @@ export class WasmVM {
93
104
sys_sleep ( millis : bigint ) : number ;
94
105
sys_attach_invocation ( invocation_id : string ) : number ;
95
106
sys_get_invocation_output ( invocation_id : string ) : number ;
96
- sys_call ( service : string , handler : string , buffer : Uint8Array , key : string | null | undefined , headers : WasmHeader [ ] ) : WasmCallHandle ;
97
- sys_send ( service : string , handler : string , buffer : Uint8Array , key : string | null | undefined , headers : WasmHeader [ ] , delay ?: bigint | null ) : WasmSendHandle ;
107
+ sys_call (
108
+ service : string ,
109
+ handler : string ,
110
+ buffer : Uint8Array ,
111
+ key : string | null | undefined ,
112
+ headers : WasmHeader [ ]
113
+ ) : WasmCallHandle ;
114
+ sys_send (
115
+ service : string ,
116
+ handler : string ,
117
+ buffer : Uint8Array ,
118
+ key : string | null | undefined ,
119
+ headers : WasmHeader [ ] ,
120
+ delay ?: bigint | null
121
+ ) : WasmSendHandle ;
98
122
sys_awakeable ( ) : WasmAwakeable ;
99
123
sys_complete_awakeable_success ( id : string , buffer : Uint8Array ) : void ;
100
124
sys_complete_awakeable_failure ( id : string , value : WasmFailure ) : void ;
@@ -105,11 +129,16 @@ export class WasmVM {
105
129
sys_run ( name : string ) : number ;
106
130
propose_run_completion_success ( handle : number , buffer : Uint8Array ) : void ;
107
131
propose_run_completion_failure ( handle : number , value : WasmFailure ) : void ;
108
- propose_run_completion_failure_transient ( handle : number , error_message : string , error_stacktrace : string | null | undefined , attempt_duration : bigint , config : WasmExponentialRetryConfig ) : void ;
132
+ propose_run_completion_failure_transient (
133
+ handle : number ,
134
+ error_message : string ,
135
+ error_stacktrace : string | null | undefined ,
136
+ attempt_duration : bigint ,
137
+ config : WasmExponentialRetryConfig
138
+ ) : void ;
109
139
sys_cancel_invocation ( target_invocation_id : string ) : void ;
110
140
sys_write_output_success ( buffer : Uint8Array ) : void ;
111
141
sys_write_output_failure ( value : WasmFailure ) : void ;
112
142
sys_end ( ) : void ;
113
143
is_processing ( ) : boolean ;
114
144
}
115
-
0 commit comments