aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/client.js
diff options
context:
space:
mode:
authorGravatar murgatroid99 <michael.lumish@gmail.com>2015-01-26 12:57:10 -0800
committerGravatar murgatroid99 <michael.lumish@gmail.com>2015-01-26 12:57:10 -0800
commitd3e95a36327c7a2249434e554846c8e44aa7daa0 (patch)
treedf7137221b1edd9367f6057166f35a90ee1340f6 /src/node/client.js
parent6cf933c4d2f618b3779b4a4f5b563aadb6f829ed (diff)
Added cancel to surface calls
Diffstat (limited to 'src/node/client.js')
-rw-r--r--src/node/client.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/node/client.js b/src/node/client.js
index 7007852b93..a039b0dcfa 100644
--- a/src/node/client.js
+++ b/src/node/client.js
@@ -161,6 +161,14 @@ GrpcClientStream.prototype._write = function(chunk, encoding, callback) {
};
/**
+ * Cancel the ongoing call. If the call has not already finished, it will finish
+ * with status CANCELLED.
+ */
+GrpcClientStream.prototype.cancel = function() {
+ self._call.cancel();
+};
+
+/**
* Make a request on the channel to the given method with the given arguments
* @param {grpc.Channel} channel The channel on which to make the request
* @param {string} method The method to request