Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding stop.

  • Loading branch information...
commit 8be37145e2de1cd9fa98303267377bdc2f4592ab 1 parent 17fb230
@mikeal mikeal authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 index.js
View
22 index.js
@@ -25,6 +25,28 @@ Commands.prototype.ps = function (cb) {
hub.ps(em.emit.bind(em));
});
}
+Commands.prototype.stop = function (pid, cb) {
+ var self = this;
+ var p = propagit(self.opts);
+ var called = false;
+ p.on('error', function (err) {
+ if (!called) cb(err);
+ called = true;
+ });
+
+ p.hub(function (hub) {
+ var opts = {
+ drone : self.opts.drone,
+ drones : self.opts.drones,
+ pid : pid
+ };
+ hub.stop(opts, function (drone) {
+ p.hub.close();
+ if (!called) cb(null, drone);
+ called = true;
+ });
+ });
+}
module.exports = function (opts) {
return new Commands(opts)
Please sign in to comment.
Something went wrong with that request. Please try again.