cluster: add handle ref/unref stubs in rr mode
authorBen Noordhuis <info@bnoordhuis.nl>
Wed, 29 Jul 2015 23:05:11 +0000 (01:05 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 30 Jul 2015 16:17:53 +0000 (18:17 +0200)
commitfa98b97171d9b8519bdbf5d9f8dbd8639ac3c050
tree266415c8be075aeed4c3f0a4cfa9bc7333bedbef
parent3cbb5870e5c8ce6a9da718c7fff6f50709545ed5
cluster: add handle ref/unref stubs in rr mode

Add ref() and unref() stub methods to the faux handle in round-robin
mode.  Fixes the following TypeError when calling `server.unref()` in
the worker:

    net.js:1521
        this._handle.unref();
                     ^
    TypeError: this._handle.unref is not a function
        at Server.unref (net.js:1521:18)

No actual reference counting is implemented.  It would effectively be
a no-op because the control channel would still keep the worker alive.

Fixes: https://github.com/nodejs/node/issues/73
PR-URL: https://github.com/nodejs/io.js/pull/2274
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
lib/cluster.js
test/parallel/test-cluster-rr-ref.js [new file with mode: 0644]