2022-03-27 09:31:12 +00:00
|
|
|
import { SysCallMapping } from "../../plugos/system";
|
2022-03-25 11:03:06 +00:00
|
|
|
import { Space } from "../space";
|
|
|
|
|
|
|
|
export function systemSyscalls(space: Space): SysCallMapping {
|
|
|
|
return {
|
|
|
|
async invokeFunctionOnServer(ctx, name: string, ...args: any[]) {
|
|
|
|
if (!ctx.plug) {
|
|
|
|
throw Error("No plug associated with context");
|
|
|
|
}
|
|
|
|
return await space.wsCall("invokeFunction", ctx.plug.name, name, ...args);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|