|
3 | 3 |
|
4 | 4 | import defaultMethods from './defaultMethods.js' |
5 | 5 | import LogicEngine from './logic.js' |
6 | | -import asyncPool from './asyncPool.js' |
7 | 6 | import { isSync } from './constants.js' |
8 | 7 | import declareSync from './utilities/declareSync.js' |
9 | 8 | import { buildAsync } from './compiler.js' |
@@ -204,11 +203,11 @@ class AsyncLogicEngine { |
204 | 203 | /** |
205 | 204 | * |
206 | 205 | * @param {*} logic The logic to be built. |
207 | | - * @param {{ top?: Boolean, above?: any, max?: Number }} options |
| 206 | + * @param {{ top?: Boolean, above?: any }} options |
208 | 207 | * @returns {Promise<Function>} |
209 | 208 | */ |
210 | 209 | async build (logic, options = {}) { |
211 | | - const { above = [], max = 100, top = true } = options |
| 210 | + const { above = [], top = true } = options |
212 | 211 | this.fallback.truthy = this.truthy |
213 | 212 | if (top) { |
214 | 213 | const constructedFunction = await buildAsync(logic, { |
@@ -238,21 +237,10 @@ class AsyncLogicEngine { |
238 | 237 |
|
239 | 238 | return result |
240 | 239 | }, top !== true && isSync(constructedFunction)) |
241 | | - // we can avoid the async pool if the constructed function is synchronous since the data |
242 | | - // can't be updated :) |
243 | | - if (top === true && constructedFunction && !isSync(constructedFunction) && typeof constructedFunction === 'function') { |
244 | | - // we use this async pool so that we can execute these in parallel without having |
245 | | - // concerns about the data. |
246 | | - return asyncPool({ |
247 | | - free: [result], |
248 | | - max, |
249 | | - create: () => this.build(logic, { ...options, above }) |
250 | | - }) |
251 | | - } else { |
252 | | - return typeof constructedFunction === 'function' || top === true |
253 | | - ? result |
254 | | - : constructedFunction |
255 | | - } |
| 240 | + |
| 241 | + return typeof constructedFunction === 'function' || top === true |
| 242 | + ? result |
| 243 | + : constructedFunction |
256 | 244 | } |
257 | 245 |
|
258 | 246 | return logic |
|
0 commit comments