Skip to content

Service Protocol V4 #477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/* tslint:disable */
/* eslint-disable */
/**
* Setups the WASM module
*/
* Setups the WASM module
*/
export function start(): void;
/**
* This will set the log level of the overall log subscriber.
* @param {LogLevel} level
*/
* This will set the log level of the overall log subscriber.
*/
export function set_log_level(level: LogLevel): void;
/**
*/
export function cancel_handle(): number;
export enum LogLevel {
TRACE = 0,
DEBUG = 1,
Expand All @@ -23,8 +21,6 @@ export interface WasmFailure {
message: string;
}

export type WasmSendHandle = number;

export interface WasmExponentialRetryConfig {
initial_interval: number | undefined;
factor: number;
Expand All @@ -38,256 +34,79 @@ export interface WasmAwakeable {
handle: number;
}

export type WasmAsyncResultValue = "NotReady" | "Empty" | { Success: Uint8Array } | { Failure: WasmFailure } | { StateKeys: string[] } | { InvocationId: string } | { CombinatorResult: WasmAsyncResultHandle[] };
export type WasmAsyncResultValue = "NotReady" | "Empty" | { Success: Uint8Array } | { Failure: WasmFailure } | { StateKeys: string[] } | { InvocationId: string };

export type WasmRunEnterResult = { ExecutedWithSuccess: Uint8Array } | { ExecutedWithFailure: WasmFailure } | "NotExecuted";
export type WasmDoProgressResult = "AnyCompleted" | "ReadFromInput" | "WaitingPendingRun" | { ExecuteRun: number } | "CancelSignalReceived";

export interface WasmCallHandle {
invocation_id_completion_id: number;
call_completion_id: number;
}

export interface WasmSendHandle {
invocation_id_completion_id: number;
}

/**
*/
export class WasmHeader {
free(): void;
/**
* @param {string} key
* @param {string} value
*/
constructor(key: string, value: string);
/**
*/
readonly key: string;
/**
*/
readonly value: string;
}
/**
*/
export class WasmIdentityVerifier {
free(): void;
/**
* @param {(string)[]} keys
*/
constructor(keys: (string)[]);
/**
* @param {string} path
* @param {(WasmHeader)[]} headers
*/
verify_identity(path: string, headers: (WasmHeader)[]): void;
constructor(keys: string[]);
verify_identity(path: string, headers: WasmHeader[]): void;
}
/**
*/
export class WasmInput {
private constructor();
free(): void;
/**
*/
readonly headers: (WasmHeader)[];
/**
*/
readonly input: Uint8Array;
/**
*/
readonly invocation_id: string;
/**
*/
readonly key: string;
readonly headers: WasmHeader[];
readonly input: Uint8Array;
}
/**
*/
export class WasmResponseHead {
private constructor();
free(): void;
/**
*/
readonly headers: (WasmHeader)[];
/**
*/
readonly status_code: number;
readonly headers: WasmHeader[];
}
/**
*/
export class WasmVM {
free(): void;
/**
* @param {(WasmHeader)[]} headers
* @param {LogLevel} log_level
* @param {number} logger_id
*/
constructor(headers: (WasmHeader)[], log_level: LogLevel, logger_id: number);
/**
* @returns {WasmResponseHead}
*/
constructor(headers: WasmHeader[], log_level: LogLevel, logger_id: number);
get_response_head(): WasmResponseHead;
/**
* @param {Uint8Array} buffer
*/
notify_input(buffer: Uint8Array): void;
/**
*/
notify_input_closed(): void;
/**
* @param {string} error_message
* @param {string | undefined} [error_description]
*/
notify_error(error_message: string, error_description?: string): void;
/**
* @returns {any}
*/
notify_error(error_message: string, stacktrace?: string | null): void;
take_output(): any;
/**
* @returns {boolean}
*/
is_ready_to_execute(): boolean;
/**
* @param {number} handle
*/
notify_await_point(handle: number): void;
/**
* @param {number} handle
* @returns {WasmAsyncResultValue}
*/
take_async_result(handle: number): WasmAsyncResultValue;
/**
* @returns {WasmInput}
*/
is_completed(handle: number): boolean;
do_progress(handles: Uint32Array): WasmDoProgressResult;
take_notification(handle: number): WasmAsyncResultValue;
sys_input(): WasmInput;
/**
* @param {string} key
* @returns {number}
*/
sys_get_state(key: string): number;
/**
* @returns {number}
*/
sys_get_state_keys(): number;
/**
* @param {string} key
* @param {Uint8Array} buffer
*/
sys_set_state(key: string, buffer: Uint8Array): void;
/**
* @param {string} key
*/
sys_clear_state(key: string): void;
/**
*/
sys_clear_all_state(): void;
/**
* @param {bigint} millis
* @returns {number}
*/
sys_sleep(millis: bigint): number;
/**
* @param {string} service
* @param {string} handler
* @param {Uint8Array} buffer
* @param {string | undefined} key
* @param {(WasmHeader)[]} headers
* @returns {number}
*/
sys_call(service: string, handler: string, buffer: Uint8Array, key: string | undefined, headers: (WasmHeader)[]): number;
/**
* @param {string} service
* @param {string} handler
* @param {Uint8Array} buffer
* @param {string | undefined} key
* @param {(WasmHeader)[]} headers
* @param {bigint | undefined} [delay]
* @returns {WasmSendHandle}
*/
sys_send(service: string, handler: string, buffer: Uint8Array, key: string | undefined, headers: (WasmHeader)[], delay?: bigint): WasmSendHandle;
/**
* @returns {WasmAwakeable}
*/
sys_call(service: string, handler: string, buffer: Uint8Array, key: string | null | undefined, headers: WasmHeader[]): WasmCallHandle;
sys_send(service: string, handler: string, buffer: Uint8Array, key: string | null | undefined, headers: WasmHeader[], delay?: bigint | null): WasmSendHandle;
sys_awakeable(): WasmAwakeable;
/**
* @param {string} id
* @param {Uint8Array} buffer
*/
sys_complete_awakeable_success(id: string, buffer: Uint8Array): void;
/**
* @param {string} id
* @param {WasmFailure} value
*/
sys_complete_awakeable_failure(id: string, value: WasmFailure): void;
/**
* @param {string} key
* @returns {number}
*/
sys_get_promise(key: string): number;
/**
* @param {string} key
* @returns {number}
*/
sys_peek_promise(key: string): number;
/**
* @param {string} key
* @param {Uint8Array} buffer
* @returns {number}
*/
sys_complete_promise_success(key: string, buffer: Uint8Array): number;
/**
* @param {string} key
* @param {WasmFailure} value
* @returns {number}
*/
sys_complete_promise_failure(key: string, value: WasmFailure): number;
/**
* @param {string} name
* @returns {WasmRunEnterResult}
*/
sys_run_enter(name: string): WasmRunEnterResult;
/**
* @param {Uint8Array} buffer
* @returns {number}
*/
sys_run_exit_success(buffer: Uint8Array): number;
/**
* @param {WasmFailure} value
* @returns {number}
*/
sys_run_exit_failure(value: WasmFailure): number;
/**
* @param {string} error_message
* @param {string | undefined} error_description
* @param {bigint} attempt_duration
* @param {WasmExponentialRetryConfig} config
* @returns {number}
*/
sys_run_exit_failure_transient(error_message: string, error_description: string | undefined, attempt_duration: bigint, config: WasmExponentialRetryConfig): number;
/**
* @param {Uint8Array} buffer
*/
sys_run(name: string): number;
propose_run_completion_success(handle: number, buffer: Uint8Array): void;
propose_run_completion_failure(handle: number, value: WasmFailure): void;
propose_run_completion_failure_transient(handle: number, error_message: string, error_stacktrace: string | null | undefined, attempt_duration: bigint, config: WasmExponentialRetryConfig): void;
sys_cancel_invocation(target_invocation_id: string): void;
sys_write_output_success(buffer: Uint8Array): void;
/**
* @param {WasmFailure} value
*/
sys_write_output_failure(value: WasmFailure): void;
/**
*/
sys_end(): void;
/**
* @returns {boolean}
*/
is_processing(): boolean;
/**
* @returns {boolean}
*/
is_inside_run(): boolean;
/**
* @param {Uint32Array} handles
* @returns {number | undefined}
*/
sys_try_complete_all_combinator(handles: Uint32Array): number | undefined;
/**
* @param {Uint32Array} handles
* @returns {number | undefined}
*/
sys_try_complete_any_combinator(handles: Uint32Array): number | undefined;
/**
* @param {Uint32Array} handles
* @returns {number | undefined}
*/
sys_try_complete_all_settled_combinator(handles: Uint32Array): number | undefined;
/**
* @param {Uint32Array} handles
* @returns {number | undefined}
*/
sys_try_complete_race_combinator(handles: Uint32Array): number | undefined;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

import * as wasm from "./sdk_shared_core_wasm_bindings_bg.wasm";
export * from "./sdk_shared_core_wasm_bindings_bg.js";
import { __wbg_set_wasm } from "./sdk_shared_core_wasm_bindings_bg.js";
__wbg_set_wasm(wasm);
export * from "./sdk_shared_core_wasm_bindings_bg.js";

wasm.__wbindgen_start();
Loading
Loading