#4127·crawlee

Add an optional `taskId` argument to `IConcurrencySystem` booking methods

Author: MantisusCreated Sep 15, 2026Updated Sep 16, 2026
Labelsfeaturet-tooling

Which package is the feature request for? If unsure which one to select, leave blank

None

Feature

Add an optional taskId argument to tryRegisterTaskStart and registerTaskEnd in IConcurrencySystem, so a concurrency system can match the end of a task to its start.

Motivation

An alternative concurrency system can use how long tasks run to decide on concurrency. Without a way to match the end of a task to its start, it can't tell a task's duration, which tasks started while a concurrency level was being measured, or how long the tasks still running have been running.

Ideal solution or implementation, and any additional constraints

typescript
tryRegisterTaskStart(consumer: ConcurrencyConsumer, taskId?: string): boolean;
registerTaskEnd(consumer: ConcurrencyConsumer, taskId?: string): void;
  • AutoscaledPool passes the same id to both calls, unique within the pool, since consumer already tells pools apart.

Alternative solutions or implementations

No response

Other context

No response