You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1ca7ec5
Browse filesBrowse the repository at this point in the historyBrowse files
stream: read stream/iter consumer sources without a layer per signal
bytes(), text(), arrayBuffer() and array() with a signal read their
source through an abortable iterator, which adds a promise, a reaction
and an iterator result to every batch.
Read the source as for await...of does, checking between batches
whether the signal has aborted, and race the whole read once with the
abort, as pipeTo() does without transforms: move that race to
raceSignal() in utils.js and use it for both. When the signal aborts,
the consumer rejects at once with the abort reason, after calling the
source's return() without waiting for it, and the source is not read
further.
For 16-byte chunks one per batch, array() of a sync generator with a
signal is about 1.9 times faster, and of an async generator about 1.35
times faster: about as fast as without a signal.
Assisted-by: OpenCode
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: #66504
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
0 commit comments