googleapis / googleapis/google-cloud-go

pubsub: allow Ack/Nack outside Receive function

Open
#8,200 5 comments 0 reactions 1 assignee Claimed by @hongalex View on GitHub
api: pubsub type: feature request
Dominant language
Go
Stars
4.5k
Forks
1.6k
Avg merge
1d 13h
Merged PRs (30d)
109

Description

**Is your feature request related to a problem? Please describe.**
I noticed that the docs were changed (in #5718) to say that `Ack()`/`Nack()` must be called inside the `Receive()` callback. Unfortunately, I have several applications built around the pubsub package that predate this and currently violate it.

**Describe the solution you'd like**
I was wondering if it would be possible to support the pattern of calling `Ack()`/`Nack()` outside of the `Receive()` callback. The reason is we want to handle messages in batches. Not all of our pubsub based applications benefit from working this way, but several do.

**Describe alternatives you've considered**
I haven't tried to reimplement these applications yet to meet the changed requirement, but that's what I'll be trying, if the pattern can't be supported!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.