-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c9b4ef
commit 31c2e7c
Showing
6 changed files
with
74 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
export const dispatch: Record<string, any> = {}; | ||
|
||
export class DispatchOp { | ||
public name: string; | ||
public opId!: number; | ||
|
||
constructor(name: string) { | ||
// @ts-ignore | ||
// Deno.core.print("registering op " + name + "\n", true); | ||
// throw new Error(`Registering op: ${name}`); | ||
if (typeof dispatch[name] !== "undefined") { | ||
throw new Error(`Duplicate op: ${name}`); | ||
} | ||
|
||
this.name = name; | ||
this.opId = 0; | ||
dispatch[name] = this; | ||
} | ||
|
||
setOpId(opId: number): void { | ||
this.opId = opId; | ||
} | ||
|
||
static handleAsyncMsgFromRust(_opId: number, _buf: Uint8Array): any { | ||
throw new Error("Unimplemented"); | ||
} | ||
|
||
static sendSync( | ||
_opId: number, | ||
_control: Uint8Array, | ||
_zeroCopy?: Uint8Array | ||
): any { | ||
throw new Error("Unimplemented"); | ||
} | ||
|
||
static sendAsync( | ||
_opId: number, | ||
_control: Uint8Array, | ||
_zeroCopy?: Uint8Array | ||
): Promise<any> { | ||
throw new Error("Unimplemented"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters