<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          node-compute-clusterNode.js 擴(kuò)展

          聯(lián)合創(chuàng)作 · 2023-09-23 18:29

          node-compute-cluster 是一個(gè)讓 Node.js 支持跨進(jìn)程分布式計(jì)算的擴(kuò)展。

          主程序:

          const computecluster = require('compute-cluster');
          
          // allocate a compute cluster
          var cc = new computecluster({
            module: './worker.js'
          });
          
          var toRun = 10
          
          // then you can perform work in parallel
          for (var i = 0; i < toRun; i++) {
            cc.enqueue({}, function(err, r) {
              if (err) console.log("an error occured:", err);
              else console.log("it's nice:", r);
              if (--toRun === 0) cc.exit();
            });
          };

          worker.js:

          process.on('message', function(m) {
            for (var i = 0; i < 100000000; i++);
            process.send('complete');
          });

           

          瀏覽 5
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧美一级A片免费看视频小说 | 女人操女人一级毛片 | 日日夜av无码一二三区 | 国产黄片久久久 | 国产欧美在线看 |