From 1ab3691b091e34ffa5a0b8f2cd18a87da8c4930c Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 10 Oct 2022 10:28:35 +0200 Subject: feat(core): add Deno.core.writeAll(rid, chunk) (#16228) This commit adds a new op_write_all to core that allows writing an entire chunk in a single async op call. Internally this calls `Resource::write_all`. The `writableStreamForRid` has been moved to `06_streams.js` now, and uses this new op. Various other code paths now also use this new op. Closes #16227 --- core/lib.deno_core.d.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/lib.deno_core.d.ts') diff --git a/core/lib.deno_core.d.ts b/core/lib.deno_core.d.ts index 7e46d0f14..2a3764730 100644 --- a/core/lib.deno_core.d.ts +++ b/core/lib.deno_core.d.ts @@ -61,6 +61,11 @@ declare namespace Deno { */ function write(rid: number, buf: Uint8Array): Promise; + /** + * Write to a (stream) resource that implements write() + */ + function writeAll(rid: number, buf: Uint8Array): Promise; + /** * Print a message to stdout or stderr */ -- cgit v1.2.3