-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert DigestStream into JS-backed stream
The original implementation of `DigestStream` used a WritableStreamSink and the old "internal" streams implementation. This is unnecessary and makes the implementation less efficient that it otherwise could be due to the operations having to bounce between the kj event loop and the JS isolate lock. This change converts `DigestStream` into a JS-backed stream where the operations occur within the isolate lock, avoiding the bounce and avoiding having to reacquire the isolate lock after each chunk, etc. Also avoids the need for IoContext addObject / IoOwn dereferencing. Implementation should be safer and more efficient. Also allow DigestStream to accept string inputs. If a string is written to a DigestStream, it will be converted to UTF-8 bytes and included in the digest. Also allow DigestStream to support `Symbol.dispose`. Improves tests a bit also.
- Loading branch information
Showing
3 changed files
with
236 additions
and
103 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
Oops, something went wrong.