Rename readPause and readResume to pause/resume
authorRyan Dahl <ry@tinyclouds.org>
Sun, 21 Feb 2010 06:38:42 +0000 (22:38 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Sun, 21 Feb 2010 06:38:42 +0000 (22:38 -0800)
doc/api.txt
src/node_net.cc
src/node_net.h
test/mjsunit/test-tcp-throttle-kernel-buffer.js
test/mjsunit/test-tcp-throttle.js

index 08ac938a88c2eada1ecf93455a341abd88008fa1..484374c33c96e79bc5089100f0cffda52230ab54 100644 (file)
@@ -1451,12 +1451,12 @@ this +readyState+ will be +"readOnly"+.
 Ensures that no more I/O activity happens on this socket. Only
 necessary in case of errors (parse error or so).
 
-+connection.readPause()+::
++connection.pause()+::
 Pauses the reading of data. That is, +"data"+ events will not be emitted.
 Useful to throttle back an upload.
 
-+connection.readResume()+::
-Resumes reading if reading was paused by +readPause()+.
++connection.resume()+::
+Resumes reading after a call to +pause()+.
 
 +connection.setTimeout(timeout)+::
 Sets the connection to timeout after +timeout+ milliseconds of inactivity on
index aaa4ddf6ae6e1e3d9013759017c0c0905cd49029..272862a8fb6972ded74ff296696029992d3f2957 100644 (file)
@@ -100,8 +100,8 @@ void Connection::Initialize(v8::Handle<v8::Object> target) {
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "close", Close);
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "forceClose", ForceClose);
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "setEncoding", SetEncoding);
-  NODE_SET_PROTOTYPE_METHOD(constructor_template, "readPause", ReadPause);
-  NODE_SET_PROTOTYPE_METHOD(constructor_template, "readResume", ReadResume);
+  NODE_SET_PROTOTYPE_METHOD(constructor_template, "pause", Pause);
+  NODE_SET_PROTOTYPE_METHOD(constructor_template, "resume", Resume);
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "setTimeout", SetTimeout);
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "setNoDelay", SetNoDelay);
   #if EVCOM_HAVE_GNUTLS
@@ -513,24 +513,24 @@ Handle<Value> Connection::GetPeerCertificate(const Arguments& args) {
 }
 #endif
 
-Handle<Value> Connection::ReadPause(const Arguments& args) {
+Handle<Value> Connection::Pause(const Arguments& args) {
   HandleScope scope;
 
   Connection *connection = ObjectWrap::Unwrap<Connection>(args.This());
   assert(connection);
 
-  connection->ReadPause();
+  connection->Pause();
 
   return Undefined();
 }
 
-Handle<Value> Connection::ReadResume(const Arguments& args) {
+Handle<Value> Connection::Resume(const Arguments& args) {
   HandleScope scope;
 
   Connection *connection = ObjectWrap::Unwrap<Connection>(args.This());
   assert(connection);
 
-  connection->ReadResume();
+  connection->Resume();
 
   return Undefined();
 }
index 35efe4160ab1df992e809c77b4f2f7ebda498a82..12e9e1dbd68ec545974bf38e160b3888e4456a70 100644 (file)
@@ -32,8 +32,8 @@ class Connection : public EventEmitter {
   static v8::Handle<v8::Value> Close(const v8::Arguments& args);
   static v8::Handle<v8::Value> ForceClose(const v8::Arguments& args);
   static v8::Handle<v8::Value> SetEncoding(const v8::Arguments& args);
-  static v8::Handle<v8::Value> ReadPause(const v8::Arguments& args);
-  static v8::Handle<v8::Value> ReadResume(const v8::Arguments& args);
+  static v8::Handle<v8::Value> Pause(const v8::Arguments& args);
+  static v8::Handle<v8::Value> Resume(const v8::Arguments& args);
   static v8::Handle<v8::Value> SetTimeout(const v8::Arguments& args);
   static v8::Handle<v8::Value> SetNoDelay(const v8::Arguments& args);
 
@@ -74,11 +74,11 @@ class Connection : public EventEmitter {
     evcom_stream_force_close(&stream_);
   }
 
-  void ReadPause() {
+  void Pause() {
     evcom_stream_read_pause(&stream_);
   }
 
-  void ReadResume() {
+  void Resume() {
     evcom_stream_read_resume(&stream_);
   }
 
index 10fdcb4b798a92af83608e3da2cecdb54f0a5b17..a8fab1f5b3159f0d4f8820d4a7535c58b0428e27 100644 (file)
@@ -31,14 +31,14 @@ client.addListener("data", function (d) {
   chars_recved += d.length;
   puts("got " + chars_recved);
   if (!paused) {
-    client.readPause();
+    client.pause();
     npauses += 1;
     paused = true;
     puts("pause");
     x = chars_recved;
     setTimeout(function () {
       assert.equal(chars_recved, x);
-      client.readResume();
+      client.resume();
       puts("resume");
       paused = false;
     }, 100);
index 239d7ccea39054cfbab2bb830b7f3405ebea7099..7e927d2d058bdbcf9dd0cc0f503875172fc429b3 100644 (file)
@@ -33,21 +33,21 @@ setTimeout(function () {
   chars_recved = recv.length;
   puts("pause at: " + chars_recved);
   assert.equal(true, chars_recved > 1);
-  client.readPause();
+  client.pause();
   setTimeout(function () {
     puts("resume at: " + chars_recved);
     assert.equal(chars_recved, recv.length);
-    client.readResume();
+    client.resume();
 
     setTimeout(function () {
       chars_recved = recv.length;
       puts("pause at: " + chars_recved);
-      client.readPause();
+      client.pause();
 
       setTimeout(function () {
         puts("resume at: " + chars_recved);
         assert.equal(chars_recved, recv.length);
-        client.readResume();
+        client.resume();
 
       }, 500);