You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Accept an AbortSignal in resource-client methods #1071
ApifyRequestConfig.signal (src/http_clients/base.ts:140) lets a caller abort httpClient.call(): the attempt in flight ends, no retry follows and the call rejects with the signal's reason. No resource-client method forwards one, so client.actor('x').get() and run.waitForFinish() cannot be aborted from a shutdown handler. They end only through their per-attempt timeout, and the polling methods default to timeoutSecs: 'noTimeout'.
Nearly every public method already takes an options object that extends TimeoutOptions (src/timeouts.ts:38), and the polling ones take ActorCallOptions, TaskCallOptions, RunWaitForFinishOptions and BuildClientWaitForFinishOptions. A signal field on those types, forwarded into the ApifyRequestConfig built in src/base/resource_client.ts and src/base/resource_collection_client.ts, covers them.
Acceptance criteria
ActorClient.call(), TaskClient.call(), RunClient.waitForFinish() and BuildClient.waitForFinish() stop polling once the signal aborts and reject with its reason.
Single-request methods whose options extend TimeoutOptions forward the signal to the request.
The zod schemas of those options accept the field, so parseArgument() does not reject it.
Activity
feat!: allow passing a custom HTTP client to ApifyClient (#1058)
feat: accept an AbortSignal in resource-client methods (#1081)
vdusek commentedon Sep 29, 2026
resolved by #1081
feat!: allow passing a custom HTTP client to ApifyClient (#1058)
feat: accept an AbortSignal in resource-client methods (#1081)