webworker-threads
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -0,1 +1,5 @@ | ||
## 0.4.0 | ||
* Support for Windows with Node.js 0.9.3+. | ||
## 0.3.2 | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "webworker-threads", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"main": "build/Release/WebWorkerThreads.node", | ||
@@ -36,3 +36,2 @@ "description": "Lightweight Web Worker API implementation with POSIX threads", | ||
"scripts": { | ||
"prepublish": "env PATH=./node_modules/.bin:\"$PATH\" lsc -cj package.ls", | ||
"js": "env PATH=./node_modules/.bin:\"$PATH\" lsc -cj package.ls;\ngcc deps/minifier/src/minify.c -o deps/minifier/bin/minify;\nenv PATH=./node_modules/.bin:\"$PATH\" lsc -cbp src/load.ls > src/load.js;\n./deps/minifier/bin/minify kLoad_js < src/load.js > src/load.js.c;\nenv PATH=./node_modules/.bin:\"$PATH\" lsc -cbp src/worker.ls > src/worker.js;\n./deps/minifier/bin/minify kWorker_js < src/worker.js > src/worker.js.c;\nenv PATH=./node_modules/.bin:\"$PATH\" lsc -cbp src/events.ls > src/events.js;\n./deps/minifier/bin/minify kEvents_js < src/events.js > src/events.js.c;\nenv PATH=./node_modules/.bin:\"$PATH\" lsc -cbp src/thread_nextTick.ls > src/thread_nextTick.js;\n./deps/minifier/bin/minify kThread_nextTick_js 1 < src/thread_nextTick.js > src/thread_nextTick.js.c;\nenv PATH=./node_modules/.bin:\"$PATH\" lsc -cbp src/createPool.ls > src/createPool.js;\n./deps/minifier/bin/minify kCreatePool_js < src/createPool.js > src/createPool.js.c;" | ||
@@ -44,11 +43,5 @@ }, | ||
"gypfile": true, | ||
"os": [ | ||
"macos", | ||
"linux", | ||
"darwin", | ||
"sunos" | ||
], | ||
"engines": { | ||
"node": ">=0.8.0" | ||
"node": ">= 0.8.0" | ||
} | ||
} |
@@ -7,4 +7,6 @@ # WebWorker Threads | ||
This module requires Node.js 0.8.0 or later. | ||
This module requires Node.js 0.8.0+. | ||
On Windows, this module requires Node.js 0.9.3+ and a working [node-gyp toolchain](http://dailyjs.com/2012/05/17/windows-and-node-3/). | ||
## Installing the module | ||
@@ -36,14 +38,17 @@ | ||
A more involved example in [LiveScript](http://livescript.net/) syntax: | ||
A more involved example in [LiveScript](http://livescript.net/) syntax, with five threads: | ||
```coffee | ||
{Worker} = require \webworker-threads | ||
w = new Worker -> | ||
{ Worker } = require \webworker-threads | ||
for til 5 => (new Worker -> | ||
fibo = (n) -> if n > 1 then fibo(n - 1) + fibo(n - 2) else 1 | ||
self.onmessage = -> self.postMessage fibo it.data | ||
w.postMessage Math.ceil Math.random! * 30 | ||
w.onmessage = -> | ||
console.log it.data | ||
w.postMessage Math.ceil Math.random! * 30 | ||
do function spin | ||
self.onmessage = ({ data }) -> self.postMessage fibo data | ||
) | ||
..onmessage = ({ data }) -> | ||
console.log "[#{ @thread.id }] #data" | ||
@postMessage Math.ceil Math.random! * 30 | ||
..postMessage Math.ceil Math.random! * 30 | ||
do spin = -> | ||
process.stdout.write '.' | ||
@@ -50,0 +55,0 @@ process.nextTick spin |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
233145
101
463