mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 23:34:47 -05:00
fec1b2a5a4
- Improves op performance. - Handle op-metadata (errors, promise IDs) explicitly in the op-layer vs per op-encoding (aka: out-of-payload). - Remove shared queue & custom "asyncHandlers", all async values are returned in batches via js_recv_cb. - The op-layer should be thought of as simple function calls with little indirection or translation besides the conceptually straightforward serde_v8 bijections. - Preserve concepts of json/bin/min as semantic groups of their inputs/outputs instead of their op-encoding strategy, preserving these groups will also facilitate partial transitions over to v8 Fast API for the "min" and "bin" groups
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
|
|
|
// deno-lint-ignore-file no-explicit-any
|
|
|
|
/// <reference no-default-lib="true" />
|
|
/// <reference lib="esnext" />
|
|
|
|
declare namespace Deno {
|
|
declare namespace core {
|
|
/** Send a JSON op to Rust, and synchronously receive the result. */
|
|
function jsonOpSync(
|
|
opName: string,
|
|
args?: any,
|
|
zeroCopy?: Uint8Array,
|
|
): any;
|
|
|
|
/** Send a JSON op to Rust, and asynchronously receive the result. */
|
|
function jsonOpAsync(
|
|
opName: string,
|
|
args?: any,
|
|
zeroCopy?: Uint8Array,
|
|
): Promise<any>;
|
|
|
|
/**
|
|
* Retrieve a list of all registered ops, in the form of a map that maps op
|
|
* name to internal numerical op id.
|
|
*/
|
|
function ops(): Record<string, number>;
|
|
|
|
/**
|
|
* Retrieve a list of all open resources, in the form of a map that maps
|
|
* resource id to the resource name.
|
|
*/
|
|
function resources(): Record<string, string>;
|
|
|
|
/** Close the resource with the specified op id. */
|
|
function close(rid: number): void;
|
|
|
|
/** Get heap stats for current isolate/worker */
|
|
function heapStats(): Record<string, number>;
|
|
}
|
|
}
|