summaryrefslogtreecommitdiff
path: root/js/dispatch_minimal.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/dispatch_minimal.ts')
-rw-r--r--js/dispatch_minimal.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/dispatch_minimal.ts b/js/dispatch_minimal.ts
index df0a290b2..483342127 100644
--- a/js/dispatch_minimal.ts
+++ b/js/dispatch_minimal.ts
@@ -52,6 +52,19 @@ export function handleAsyncMsgFromRustMinimal(
promise!.resolve(result);
}
+export function sendSyncMinimal(
+ opId: number,
+ arg: number,
+ zeroCopy: Uint8Array
+): number {
+ scratch32[0] = 0; // promiseId 0 indicates sync
+ scratch32[1] = arg;
+ const res = core.dispatch(opId, scratchBytes, zeroCopy)!;
+ const res32 = new Int32Array(res.buffer, res.byteOffset, 3);
+ const resRecord = recordFromBufMinimal(opId, res32);
+ return resRecord.result;
+}
+
export function sendAsyncMinimal(
opId: number,
arg: number,