Skip to content

AbortSignal support for the subscriber client #2053

@danmichaelo

Description

@danmichaelo

A screenshot that you have tested with "Try this API".

This problem applies specifically to the Node.js client. It's not an issue with the API itself.

What would you like to see in the library?

A way to abort cleanly when the service needs to exit (without setting a very low timeout). It would be nice if the pull method supported AbortSignal like so since AbortSignal is becoming the standard way to abort promises:

const abortController = new AbortController();
const client = new v1.SubscriberClient({ projectId });

const [response] = await client.pull({
  subscription: subscriptionId,
  maxMessages: 100,
}, {
  signal: abortController.signal   <-- This
});

Describe alternatives you've considered

No response

Additional context/notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: pubsubIssues related to the googleapis/nodejs-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions