1.0.1 • Published 7 months ago

@leniumso/threadpool v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

ThreadPool.js

Parallel operations in js. ThreadPool in js.

import ThreadPool from '@leniumso/threadpool';

function threadFunction(num) {
    function fib(n) {
        return n <= 1 ? n : fib(n - 1) + fib(n - 2);
    }

    return fib(num);
}

ThreadPool.isDebugging = true;

ThreadPool.run(threadFunction, 40);
ThreadPool.run(threadFunction, 30);
ThreadPool.run(threadFunction, 45);
1.0.1

7 months ago

1.0.0

7 months ago