Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
node-worker library with worker pool support.
JavaScript
branch: master

This branch is 9 commits ahead of cramforce:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
lib
test
LICENSE
Makefile
README.md
index.js
package.json

README.md

node-worker - 0.0.1

node-worker is an implementation of the WebWorker API for node.js. http://www.whatwg.org/specs/web-workers/current-work/

Example

var Worker = require("../lib/worker").Worker;

var worker = new Worker("worker.js");

worker.postMessage({
  hello: "world"
});

worker.onmessage = function (msg) {
  sys.puts(msg.hello);
};

worker.addListener("message", function (msg) {
  sys.puts(msg.hello);
  worker.terminate();
});

Example Worker File

var worker = require("worker").worker;

worker.onmessage = function (msg) {
  worker.postMessage({
    hello: "mother"
  });
};
Something went wrong with that request. Please try again.