File tree Expand file tree Collapse file tree 3 files changed +30
-30
lines changed Expand file tree Collapse file tree 3 files changed +30
-30
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,17 @@ Writer.prototype.once = function() {};
6565Writer . prototype . emit = function ( ) { } ;
6666
6767
68+ function flow ( ) {
69+ var dest = this . dest ;
70+ var res = dest . write ( chunk , encoding ) ;
71+ if ( ! res )
72+ dest . once ( 'drain' , this . flow ) ;
73+ else
74+ process . nextTick ( this . flow ) ;
75+ }
76+
6877function Reader ( ) {
69- this . flow = this . flow . bind ( this ) ;
78+ this . flow = flow . bind ( this ) ;
7079 this . readable = true ;
7180}
7281
@@ -76,15 +85,6 @@ Reader.prototype.pipe = function(dest) {
7685 return dest ;
7786} ;
7887
79- Reader . prototype . flow = function ( ) {
80- var dest = this . dest ;
81- var res = dest . write ( chunk , encoding ) ;
82- if ( ! res )
83- dest . once ( 'drain' , this . flow ) ;
84- else
85- process . nextTick ( this . flow ) ;
86- } ;
87-
8888
8989function server ( ) {
9090 var reader = new Reader ( ) ;
Original file line number Diff line number Diff line change @@ -65,8 +65,17 @@ Writer.prototype.once = function() {};
6565Writer . prototype . emit = function ( ) { } ;
6666
6767
68+ function flow ( ) {
69+ var dest = this . dest ;
70+ var res = dest . write ( chunk , encoding ) ;
71+ if ( ! res )
72+ dest . once ( 'drain' , this . flow ) ;
73+ else
74+ process . nextTick ( this . flow ) ;
75+ }
76+
6877function Reader ( ) {
69- this . flow = this . flow . bind ( this ) ;
78+ this . flow = flow . bind ( this ) ;
7079 this . readable = true ;
7180}
7281
@@ -76,15 +85,6 @@ Reader.prototype.pipe = function(dest) {
7685 return dest ;
7786} ;
7887
79- Reader . prototype . flow = function ( ) {
80- var dest = this . dest ;
81- var res = dest . write ( chunk , encoding ) ;
82- if ( ! res )
83- dest . once ( 'drain' , this . flow ) ;
84- else
85- process . nextTick ( this . flow ) ;
86- } ;
87-
8888
8989function server ( ) {
9090 var reader = new Reader ( ) ;
Original file line number Diff line number Diff line change @@ -65,8 +65,17 @@ Writer.prototype.once = function() {};
6565Writer . prototype . emit = function ( ) { } ;
6666
6767
68+ function flow ( ) {
69+ var dest = this . dest ;
70+ var res = dest . write ( chunk , encoding ) ;
71+ if ( ! res )
72+ dest . once ( 'drain' , this . flow ) ;
73+ else
74+ process . nextTick ( this . flow ) ;
75+ }
76+
6877function Reader ( ) {
69- this . flow = this . flow . bind ( this ) ;
78+ this . flow = flow . bind ( this ) ;
7079 this . readable = true ;
7180}
7281
@@ -76,15 +85,6 @@ Reader.prototype.pipe = function(dest) {
7685 return dest ;
7786} ;
7887
79- Reader . prototype . flow = function ( ) {
80- var dest = this . dest ;
81- var res = dest . write ( chunk , encoding ) ;
82- if ( ! res )
83- dest . once ( 'drain' , this . flow ) ;
84- else
85- process . nextTick ( this . flow ) ;
86- } ;
87-
8888
8989function server ( ) {
9090 var reader = new Reader ( ) ;
You can’t perform that action at this time.
0 commit comments