Skip to content
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

docs: explain how to nack a sync pull message #123

Merged
merged 2 commits into from Jun 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 14 additions & 1 deletion docs/subscriber/index.rst
Expand Up @@ -64,9 +64,20 @@ To pull the messages synchronously, use the client's
subscriber.acknowledge(subscription_path, ack_ids)
The method returns a :class:`~.pubsub_v1.types.PullResponse` instance that
cointains a list of received :class:`~.pubsub_v1.types.ReceivedMessage`
contains a list of received :class:`~.pubsub_v1.types.ReceivedMessage`
instances.

If you want to **nack** some of the received messages (see :ref:`explaining-ack` below),
you can use the :meth:`~.pubsub_v1.subscriber.client.Client.modify_ack_deadline`
method and set their acknowledge deadlines to zero. This will cause them to
be dropped by this client and the backend will try to re-deliver them.

.. code-block:: python
ack_ids = [] # TODO: populate with `ack_ids` of the messages to NACK
ack_deadline_seconds = 0
subscriber.modify_ack_deadline(subscription_path, ack_ids, ack_deadline_seconds)
Pulling a Subscription Asynchronously
-------------------------------------
Expand Down Expand Up @@ -159,6 +170,8 @@ receiving messages.
future.cancel()
.. _explaining-ack:

Explaining Ack
--------------

Expand Down