-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#798: Add support for auto-acknowledging pulled messages. #1636
Conversation
@@ -272,3 +272,30 @@ Fetch messages for a pull subscription without blocking (none pending): | |||
>>> messages = [recv[1] for recv in received] | |||
>>> [message.message_id for message in messages] | |||
[] | |||
|
|||
Fetch pending messages, acknowledging those whose processing doesn't raise an |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
... batch.publish('this is the second message_payload', | ||
... attr1='value1', attr2='value2') | ||
>>> from gcloud.pubsub.subscription import AutoAck | ||
>>> with AutoAck(subscription, max_messages=10) as ack: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
LGTM, I don't really have the whole story for this though. |
Follows @tmatsuo's suggested implementation in: #798 (comment) Closes #798.
Addresses (on the other PR): #1637 (comment)
Rebased to pick up pylint fixes on |
Follows @tmatsuo's suggested implementation.
Closes #798.
Hold off merging until comparing with the alternate implementation suggested by @jgeewax. (#1637)