Noteworthy Programming Masterpiece

    compatible-pool
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    compatible-pool

    Build Status Coverage Status

    Runs a map function on a set of values. The function will run on as many processors your machine has, or on max processes.

    new Pool({ max: number, create: async () => res, destroy: res => (destroys res) })

    • max: maximum number of parallel processes
    • create: return your resource here as a promise
    • destroy: destroy your resource

    pool.acquire() -> Promise

    Aquire a resource from the pool. This can take longer if the maximum number of processes has been reached.

    pool.release(res)

    Release a resource in the pool.

    pool.clear()

    Clear everything in the pool.

    Keywords

    none

    Install

    npm i compatible-pool

    DownloadsWeekly Downloads

    32

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    77.2 kB

    Total Files

    27

    Last publish

    Collaborators

    • fabiosantoscode