From ebd4626a61bb1074939b47f26a28a07c6dc33601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Geisendo=CC=88rfer?= Date: Tue, 19 Jul 2011 09:24:01 +0200 Subject: [PATCH] Make worker accessible to plugins Problem: There was previously no way to get a hold of the Worker instance inside a worker when writing a plugin. This patch provides such a reference by attaching the Worker instance to the Master instance inside a worker. --- lib/master.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/master.js b/lib/master.js index 7a8f16c..63f005b 100644 --- a/lib/master.js +++ b/lib/master.js @@ -290,6 +290,7 @@ Master.prototype.start = function(fn){ Master.prototype.startWorker = function(){ var worker = new Worker(this); + this.worker = worker; var sock = this.sock = dgram.createSocket('unix_dgram'); sock.on('listening', worker.start.bind(worker)); sock.bind(this.clientSocketPath);