File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,13 @@ const assert = require('assert');
55const Readable = require ( '_stream_readable' ) ;
66const Writable = require ( '_stream_writable' ) ;
77
8- // Pipe should not continue writing if writable needs drain.
8+ // Pipe should pause temporarily if writable needs drain.
99{
1010 const w = new Writable ( {
1111 write ( buf , encoding , callback ) {
12-
13- }
12+ process . nextTick ( callback ) ;
13+ } ,
14+ highWaterMark : 1
1415 } ) ;
1516
1617 while ( w . write ( 'asd' ) ) ;
@@ -20,10 +21,12 @@ const Writable = require('_stream_writable');
2021 const r = new Readable ( {
2122 read ( ) {
2223 this . push ( 'asd' ) ;
24+ this . push ( null ) ;
2325 }
2426 } ) ;
2527
26- w . write = common . mustNotCall ( ) ;
28+ r . on ( 'pause' , common . mustCall ( ) ) ;
29+ r . on ( 'end' , common . mustCall ( ) ) ;
2730
2831 r . pipe ( w ) ;
2932}
You can’t perform that action at this time.
0 commit comments