-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream: internal vs external API and streamlike compat #29006
Comments
@mcollina are you +1 on exposing if (!writable.writableCorked) {
// Don't install nextTick if we are already corked.
writable.cork()
process.nextTick(() => {
writable.uncork()
})
} |
The cork() API is designed so you can avoid that pattern, as cork() can be called multiple times. However, I’m +1 on adding this API. |
It's more about avoiding creating unnecessary |
+1
Il giorno mar 6 ago 2019 alle 13:34 Robert Nagy <[email protected]>
ha scritto:
… The cork() API is designed so you can avoid that pattern, as cork() can be
called multiple times.
It's more about avoiding creating unnecessary nextTick. We have this
exact case in OutgoingMessage where we use a ´kIsCorked` symbol to
achieve the same thing.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29006?email_source=notifications&email_token=AAAMXY4CUVPX52WJAKFWF2DQDFOTPA5CNFSM4IJU5RD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3U2ZNQ#issuecomment-518630582>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAMXY7K3BUV3M6TI7MUNH3QDFOTPANCNFSM4IJU5RDQ>
.
|
this is pretty much done |
Try to avoid using internal stream state. Make properties that are used externally part of stream public API. Also improve combat with streamlike objects.
The text was updated successfully, but these errors were encountered: