way2explore2
V2EX  ›  Node.js

PambdaJS 易用的 node 多进程工具

  •  
  •   way2explore2 · Aug 25, 2020 · 2084 views
    This topic created in 2149 days ago, the information mentioned may be changed or developed.

    PambdaJS

    • 易用
    import pambda from 'pambdajs';
    const p = await pambda.init(5);
    
    data = [1,2,3];
    const heavyWork = (x) => {
        return x+x;
    }
    // original single process way
    const singleProcess = () => {
      data.map(heavyWork);
    }
    
    // PambdaJS multi process way
    const pambdaProcess = async () => {
      await p.map(heavyWork, cb);
    }
    
    • 高性能 ( heavy work )
    1 replies    2020-09-06 19:06:33 +08:00
    way2explore2
        1
    way2explore2  
    OP
       Sep 6, 2020
    https://www.npmjs.com/package/pambdajs

    1.1.1 发布, 移除了一个不必须的 dependency

    包体积再缩小 1kb
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5367 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 09:14 · PVG 17:14 · LAX 02:14 · JFK 05:14
    ♥ Do have faith in what you're doing.