xref: /third_party/node/test/parallel/test-stream-write-drain.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst { Writable } = require('stream');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci// Don't emit 'drain' if ended
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciconst w = new Writable({
81cb0ef41Sopenharmony_ci  write(data, enc, cb) {
91cb0ef41Sopenharmony_ci    process.nextTick(cb);
101cb0ef41Sopenharmony_ci  },
111cb0ef41Sopenharmony_ci  highWaterMark: 1
121cb0ef41Sopenharmony_ci});
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ciw.on('drain', common.mustNotCall());
151cb0ef41Sopenharmony_ciw.write('asd');
161cb0ef41Sopenharmony_ciw.end();
17

Indexes created Thu Nov 07 10:32:03 CST 2024