|
|
|
|
|
by TweedHeads
6172 days ago
|
|
Why web workers can't take a function or an object? myobject={
start: function(){ /* do stuff */ }
stop: function(){ /* end worker */ }
postMessage:function(){ /* communicate */ }
onmessage: function(){ /* receiving data*/ }
onerror: function(){ /* handle stuff */ }
}
myworker = new Worker(myobject);
myworker.start();
myworker.postMessage("dostuff");
myworker.stop();
Or something like that... |
|
On the other hand, allowing for an easy way to call global functions of the child worker would be really nice.
Child Worker: That would be sexy and surely simplify a lot of logic surrounding message passing.