Skip to content

Conversation

@mafintosh
Copy link
Owner

wip (will be a major bump if it lands)

moves ._write, ._read, ._final etc to promises instead of cbs.
does some tricks to avoid ticks when streams are sync to get that perf :)

missing test migration and transform streams still

while (this.buffered < this.highWaterMark && (stream._duplexState & SHOULD_NOT_READ) === 0) {
stream._duplexState |= READ_ACTIVE_AND_SYNC_AND_NEEDS_PUSH
stream._read(this.afterRead)
const p = stream._read()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callPromise(this, stream.read(), this.afterRead, this.afterReadError) ?

index.js Outdated
while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED) {
const data = this.shift()
stream._duplexState |= WRITE_ACTIVE_AND_SYNC
stream._write(data, this.afterWrite)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callPromise(this, stream._write(data), this.afterWrite, this.afterWriteError) ?

})
}

function finished (stream) {
Copy link
Contributor

@martinheidegger martinheidegger Feb 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be in a different PR? Seems to be usable immediately?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants