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/01_core.js | 1 + 1 file changed, 1 insertion(+) (limited to 'core/01_core.js') diff --git a/core/01_core.js b/core/01_core.js index 655b4219e..b98e54160 100644 --- a/core/01_core.js +++ b/core/01_core.js @@ -329,6 +329,7 @@ tryClose: (rid) => ops.op_try_close(rid), read: opAsync.bind(null, "op_read"), write: opAsync.bind(null, "op_write"), + writeAll: opAsync.bind(null, "op_write_all"), shutdown: opAsync.bind(null, "op_shutdown"), print: (msg, isErr) => ops.op_print(msg, isErr), setMacrotaskCallback: (fn) => ops.op_set_macrotask_callback(fn), -- cgit v1.2.3