Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7756561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:51:19+00:00 2026-06-01T12:51:19+00:00

The documentation for write() says: Returns false to indicate that the kernel buffer is

  • 0

The documentation for write() says:

Returns false to indicate that the kernel buffer is full, and the data will be sent out in the future.

and the documentation for the drain event says:

After a write() method returned false, this event is emitted to indicate that it is safe to write again.

What does that mean? Do I have to wait for the drain event before I can write again? What happened to the data which I tried to write? Is that lost? What happens when I call write without waiting for the drain event?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:51:20+00:00Added an answer on June 1, 2026 at 12:51 pm

    You can call write() without caring about the return value safely. Node will buffer any write calls while the kernel buffer is full, and push them in order as you would expect. You do not need to wait for the 'drain' event before writing again.

    Optionally, you can check the return value of write() and then notify the thing that is writing to the Stream that the buffer is full. This is exactly what Stream#pipe() does.

    So usually, just use Stream#pipe() and all the goodies are taken care of for you 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

MSDN documentation says that instance methods, which includes Stream.Write, of Stream class are not
I'm required to write documentation for my current project that lists all .c files
I have seen documentation on the IronPython mailing list that describes how to write
AS3 documentation says that Strings in AS3 are in UTF-16 format. There is a
I am aware that the Lucene documentation says Note: The NOT operator cannot be
Some code: import cStringIO def f(): buffer = cStringIO.StringIO() buffer.write('something') return buffer.getvalue() The documentation
I am using a FileSystemWatcher to monitor changes to files. MSDN documentation says that
I am trying to write documentation comments however I have a problem. /// <summary>
I am implementing in app purchases for Android. And in documentation they write: registerObserver()
Duplicate of: Learning to write a compiler Documentation on creating a programming language Learning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.