Work on #508 (thin client)
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
import { KVStore } from "../../plugos/lib/kv_store.ts";
|
||||
import { storeSyscalls } from "../../plugos/syscalls/store.ts";
|
||||
import { proxySyscalls } from "../../plugos/syscalls/transport.ts";
|
||||
import { SysCallMapping } from "../../plugos/system.ts";
|
||||
|
||||
// DEPRECATED, use store directly
|
||||
export function clientStoreSyscalls(
|
||||
storeCalls: SysCallMapping,
|
||||
db: KVStore,
|
||||
): SysCallMapping {
|
||||
const localStoreCalls = storeSyscalls(db);
|
||||
return proxySyscalls(
|
||||
["clientStore.get", "clientStore.set", "clientStore.delete"],
|
||||
(ctx, name, ...args) => {
|
||||
return storeCalls[name.replace("clientStore.", "store.")](ctx, ...args);
|
||||
return localStoreCalls[name.replace("clientStore.", "store.")](
|
||||
ctx,
|
||||
...args,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user