Permalink
Browse files

Add README.

  • Loading branch information...
1 parent cc6702a commit b11f5c9c0ad5a0fcd5f19d4b398e13e369985ed4 @pgriess pgriess committed Jun 4, 2010
Showing with 26 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +25 −0 README.md
View
@@ -0,0 +1 @@
+README.html
View
@@ -0,0 +1,25 @@
+`node-webworkers` is an experimental implementation of the [Web Workers
+API](http://www.whatwg.org/specs/web-workers/current-work/) for
+[node.js](http://nodejs.org).
+
+### Example
+
+#### Master source
+
+ var sys = require('sys');
+ var Worker = require('webworker').Worker;
+
+ var w = new Worker('foo.js');
+
+ w.onmessage = function(e) {
+ sys.debug('Received mesage: ' + sys.inspect(e));
+ w.terminate();
+ };
+
+ w.postMessage({ foo : 'bar' });
+
+#### Worker source
+
+ onmessage = function(e) {
+ postMessage({ test : 'this is a test' });
+ };

0 comments on commit b11f5c9

Please sign in to comment.