mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
Organize dispatch a bit (#2796)
Just some clean up reorganization around flatbuffer/minimal dispatch code. This is prep for adding a JSON dispatcher.
This commit is contained in:
parent
b764d1b8ff
commit
bdc97b3976
65 changed files with 663 additions and 754 deletions
|
@ -1,7 +1,5 @@
|
|||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||
import * as msg from "gen/cli/msg_generated";
|
||||
import * as flatbuffers from "./flatbuffers";
|
||||
import * as dispatch from "./dispatch";
|
||||
import { sendSync, sendAsync, msg, flatbuffers } from "./dispatch_flatbuffers";
|
||||
|
||||
function req(
|
||||
name: string,
|
||||
|
@ -20,7 +18,7 @@ function req(
|
|||
* Deno.truncateSync("hello.txt", 10);
|
||||
*/
|
||||
export function truncateSync(name: string, len?: number): void {
|
||||
dispatch.sendSync(...req(name, len));
|
||||
sendSync(...req(name, len));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -30,5 +28,5 @@ export function truncateSync(name: string, len?: number): void {
|
|||
* await Deno.truncate("hello.txt", 10);
|
||||
*/
|
||||
export async function truncate(name: string, len?: number): Promise<void> {
|
||||
await dispatch.sendAsync(...req(name, len));
|
||||
await sendAsync(...req(name, len));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue