From 15e6af17c5759f8e830e06df948cc5f8c413d40a Mon Sep 17 00:00:00 2001 From: Dav Glass Date: Tue, 12 Jun 2012 15:50:42 -0500 Subject: [PATCH] Added `agent.unload()` to clear properties on the Agent. --- lib/hub/agent.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/hub/agent.js b/lib/hub/agent.js index 3eb70551..7032e7d4 100644 --- a/lib/hub/agent.js +++ b/lib/hub/agent.js @@ -115,6 +115,13 @@ Agent.prototype.dispatch = function (urls) { this.next(); }; +Agent.prototype.unload = function () { + this.connected = false; + this.seen = 0; + this.waiting = false; + this.emit("disconnected"); +}; + Agent.prototype.ping = function () { this.connected = true; this.seen = new Date();