pgriess / node-webworker

A WebWorkers implementation for NodeJS
BSD 3-Clause "New" or "Revised" License
646 stars 84 forks source link

pid is undefined on .terminate() call #40

Open beezee opened 12 years ago

beezee commented 12 years ago

Running node 0.4.9, terminate() calls fail at the first assertion. If I log the pid to console when it is re-set after spawn, it shows up fine. If I store it as an attribute on the worker object and try to reference it there, it always comes back undefined. Here's the code that allows me to reproduce the != fail on the first line of the terminate method

var Worker = require('webworker').Worker
var worker = new Worker(__dirname+'/worker.js');
worker.terminate();

Any thoughts?