%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/vittasync.vacivitta.com.br/vittasync/node/test/parallel/
Upload File :
Create Path :
Current File : /home/vacivi36/vittasync.vacivitta.com.br/vittasync/node/test/parallel/test-stream-pipe-deadlock.js

'use strict';

const common = require('../common');
const { Readable, Writable } = require('stream');

// https://github.com/nodejs/node/issues/48666
(async () => {
  // Prepare src that is internally ended, with buffered data pending
  const src = new Readable({ read() {} });
  src.push(Buffer.alloc(100));
  src.push(null);
  src.pause();

  // Give it time to settle
  await new Promise((resolve) => setImmediate(resolve));

  const dst = new Writable({
    highWaterMark: 1000,
    write(buf, enc, cb) {
      process.nextTick(cb);
    }
  });

  dst.write(Buffer.alloc(1000)); // Fill write buffer
  dst.on('finish', common.mustCall());
  src.pipe(dst);
})().then(common.mustCall());

Zerion Mini Shell 1.0