title: Node.js writable stream _write() execution in parallel
body: <h2>Question</h2>
  
  <p>In Node.js writable-stream, are there any way to call _write() in parallel?</p>
  
  <h2>What I hope &amp; try (&amp; fail)</h2>
  
  <p>I hope to execute asynchronous functions in parallel in writable._write with highWaterMark.  </p>
  
  <p>I want to upload many files (over 10,000 !!) to cloud in parallel.<br>
  Of course, 10,000 parallel upload cause memory overflow, so I plan like below.</p>
  
  <pre><code>"filename" Readable-stream =&gt; "upload" Writable-steream
                       [highWaterMark](parallel limit)
  </code></pre>
  
  <p>So I test like below.</p>
  
  <pre><code>class uploadWritable extends Writable {
    constructor() {
      const options = {
        objectMode: true,
        highWaterMark: 10
      };
      super(options);
    }
    _write(filepath, encoding, callback){
      asyncUpload(filepath, callback); // When upload finished, callback is called.
    }
  }
  </code></pre>
  
  <p>I expect that<br>
  10 "asyncUpload" is called in parapell. And when one of "asyncUpload"s finish, new file is come from readable-stream and start "asyncUpload".<br>
  But above code cause "one by one" upload.  </p>
  
  <h2>Question</h2>
  
  <p>Is above failure because of my code?<br>
  Are there any way to execute async function in parallel with Node.js writable-stream?</p>