ringo/ringojs — Issue #159: worker code not executed until postMessage()
Author: oberhamsi
Created: 2011-11-24 12:39:29+00:00
State: open

when creating a worker, i expected the code of the worker to be executed on creation of the worker. similarly to how module code is executed on every `require()`.

but as it is now, i have to issue a `postMessage()` for the code to be executed.

for example:

worker-interval.js: https://gist.github.com/1391259

var {Worker} = require('ringo/worker')
// i expected the setInterval(), as defined in worker-interval.js, to be executed by the following call
var worker = new Worker(module.resolve('./worker-interval'))
worker.postMessage()