Skip to content

Feature: Add AbortController support to bucket.query / beginRead #118

@AnthonyCvn

Description

@AnthonyCvn

Current problem

Allow cancelling queries and reads with Fetch standard AbortController.

Possible solution

  • Accept an optional { signal?: AbortSignal } (either in QueryOptions or as a final arg).
  • Propagate signal and abort should close streams/iterators and reject with AbortError.

Additional context

Example:

const ctrl = new AbortController();
for await (const r of bucket.query(name, s, e, { ...opts }, { signal: ctrl.signal })) { ... }
ctrl.abort();

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions