@paybase/pool
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -16,4 +16,9 @@ export declare type PoolOptions<I, O, P> = { | ||
declare function createPool<I, O, P>(options?: PoolOptions<I, O, P> & SyncProcess<P>): Pool<I, O>; | ||
declare namespace createPool { | ||
var default: typeof createPool; | ||
} | ||
declare function createPool<I, O, P>(options?: PoolOptions<I, O, P> & AsyncProcess<P>): Promise<Pool<I, O>>; | ||
export { createPool }; | ||
declare namespace createPool { | ||
var default: typeof createPool; | ||
} | ||
export default createPool; |
@@ -14,5 +14,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
if (!isFunction(createProcess) && !isFunction(createAsyncProcess)) | ||
throw new Error(`Please provide a process creator`); | ||
throw new Error('Please provide a process creator'); | ||
if (isFunction(createProcess) && isFunction(createAsyncProcess)) | ||
throw new Error(`Unable to create both a sync pool and an async pool, please choose one!`); | ||
throw new Error('Unable to create both a sync pool and an async pool, please choose one!'); | ||
const inflight = []; | ||
@@ -32,3 +32,2 @@ function spawnAsyncProcess() { | ||
} | ||
; | ||
function run(value) { | ||
@@ -69,3 +68,2 @@ return new Promise(async (resolve, reject) => { | ||
} | ||
; | ||
if (createProcess) { | ||
@@ -84,4 +82,4 @@ pool.forEach(() => csp_1.put(processPool, createProcess())); | ||
} | ||
exports.createPool = createPool; | ||
; | ||
exports.default = createPool; | ||
module.exports = createPool; | ||
createPool.default = createPool; |
{ | ||
"name": "@paybase/pool", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "a pooling mechanism built on top of csp", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
9277
104