-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*! | ||
* mixture | ||
* Copyright(c) 2011 Daniel D. Shaw <dshaw@dshaw.com> | ||
* MIT Licensed | ||
*/ | ||
|
||
/** | ||
* Exports. | ||
*/ | ||
|
||
var send = exports.send = process.send || noop | ||
var taskName = exports.taskName = process.env.MIXTURE_TASK_NAME | ||
var workerId = exports.workerId = parseInt(process.env.MIXTURE_WORKER_ID) | ||
|
||
/** | ||
* Noop. | ||
*/ | ||
|
||
function noop () { console.log('worker noop', arguments) } | ||
|
||
/** | ||
* Master Message handler. | ||
*/ | ||
|
||
function onMasterMessage () { console.log('worker message', arguments) } | ||
|
||
/** | ||
* Receive messages from Mix Master. | ||
*/ | ||
|
||
process.on('message', onMasterMessage) | ||
|
||
/** | ||
* Notify Mix Master. | ||
*/ | ||
|
||
send({ 'worker:online' : workerId, task: taskName, pid: process.pid }) |