Skip to content
This repository
Browse code

Add IncomingMessage.prototype.pause() and resume().

  • Loading branch information...
commit 0638a3a3ab680b99c36cc09904d10bbfd76c65ba 1 parent 94e8721
ry ry authored

Showing 2 changed files with 23 additions and 0 deletions. Show diff stats Hide diff stats

  1. +8 0 src/http.js
  2. +15 0 website/api.txt
8 src/http.js
@@ -134,6 +134,14 @@ IncomingMessage.prototype.setBodyEncoding = function (enc) {
134 134 this.connection.setEncoding(enc);
135 135 };
136 136
  137 +IncomingMessage.prototype.pause = function () {
  138 + this.connection.readPause();
  139 +};
  140 +
  141 +IncomingMessage.prototype.resume = function () {
  142 + this.connection.readResume();
  143 +};
  144 +
137 145
138 146 function OutgoingMessage () {
139 147 node.EventEmitter.call(this);
15 website/api.txt
@@ -706,6 +706,15 @@ The HTTP protocol version as a string. Read only. Examples:
706 706 Set the encoding for the request body. Either +"utf8"+ or +"raw"+. Defaults
707 707 to raw.
708 708
  709 +
  710 ++request.pause()+ ::
  711 +Pauses request from emitting events. Useful to throttle back an upload.
  712 +
  713 +
  714 ++request.resume()+ ::
  715 +Resumes a paused request.
  716 +
  717 +
709 718 +request.connection+ ::
710 719 The +node.http.Connection+ object.
711 720
@@ -891,6 +900,12 @@ After emitted no other events will be emitted on the response.
891 900 Set the encoding for the response body. Either +"utf8"+ or +"raw"+.
892 901 Defaults to raw.
893 902
  903 ++response.pause()+ ::
  904 + Pauses response from emitting events. Useful to throttle back a download.
  905 +
  906 ++response.resume()+ ::
  907 + Resumes a paused response.
  908 +
894 909 +response.client+ ::
895 910 A reference to the +node.http.Client+ that this response belongs to.
896 911

0 comments on commit 0638a3a

Please sign in to comment.
Something went wrong with that request. Please try again.