Removed all traces of sockets, real-time collab and other stuff.
This commit is contained in:
@@ -9,6 +9,7 @@ export class Plug<HookT> {
|
||||
readonly runtimeEnv: RuntimeEnvironment;
|
||||
grantedPermissions: string[] = [];
|
||||
name: string;
|
||||
version: number;
|
||||
|
||||
constructor(
|
||||
system: System<HookT>,
|
||||
@@ -19,6 +20,7 @@ export class Plug<HookT> {
|
||||
this.name = name;
|
||||
this.sandbox = sandboxFactory(this);
|
||||
this.runtimeEnv = system.runtimeEnv;
|
||||
this.version = new Date().getTime();
|
||||
}
|
||||
|
||||
async load(manifest: Manifest<HookT>) {
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import { SysCallMapping } from "../system";
|
||||
import { SyscallContext, SysCallMapping } from "../system";
|
||||
|
||||
export function transportSyscalls(
|
||||
names: string[],
|
||||
transportCall: (name: string, ...args: any[]) => Promise<any>
|
||||
transportCall: (
|
||||
ctx: SyscallContext,
|
||||
name: string,
|
||||
...args: any[]
|
||||
) => Promise<any>
|
||||
): SysCallMapping {
|
||||
let syscalls: SysCallMapping = {};
|
||||
|
||||
for (let name of names) {
|
||||
syscalls[name] = (ctx, ...args: any[]) => {
|
||||
return transportCall(name, ...args);
|
||||
return transportCall(ctx, name, ...args);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@ export type SystemEvents<HookT> = {
|
||||
plugUnloaded: (name: string, plug: Plug<HookT>) => void;
|
||||
};
|
||||
|
||||
type SyscallContext = {
|
||||
plug: Plug<any> | null;
|
||||
export type SyscallContext = {
|
||||
plug: Plug<any>;
|
||||
};
|
||||
|
||||
type SyscallSignature = (
|
||||
|
||||
Reference in New Issue
Block a user