Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > IAsyncParallelismOptions > allowOversubscription

IAsyncParallelismOptions.allowOversubscription property

This option affects the handling of task weights, applying a softer policy that favors maximizing parallelism instead of avoiding overload.

Signature:

allowOversubscription?: boolean;

Remarks

By default, a new task cannot start executing if doing so would push the total weight above the concurrency limit. Set allowOversubscription to true to relax this rule, allowing a new task to start as long as the current total weight is below the concurrency limit. Either way, a task cannot start if the total weight already equals the concurrency limit; therefore, allowOversubscription has no effect when all tasks have weight 1.

Example: Suppose the concurrency limit is 8, and seven tasks are running whose weights are 1, so the current total weight is 7. If an available task has weight 2, that would push the total weight to 9, exceeding the limit. This task can start only if allowOversubscription is true.