我想在F.worker2中使用一些args。 你有一些例子吗? 如何将F.worker2与Total.js一起使用?
谢谢
答案 0 :(得分:3)
只需发送其他参数https://docs.totaljs.com/latest/en.html#api~Framework~F.worker2或发送消息:
var worker = F.worker2();
// Worker has to have defined "message" event:
// process.on('message', function(msg) { console.log('Data from parent', msg); });
setImmediate(function() {
worker.send({ simple: 'value' });
});