Skip to content
Browse files
docs: explain that future.cancel() is non-blocking (#420)
  • Loading branch information
plamut committed Jun 11, 2021
1 parent e907f6e commit c825789bdff310f44cbb132a723e99d1e6331d8f
Showing with 5 additions and 0 deletions.
  1. +5 −0 google/cloud/pubsub_v1/subscriber/
@@ -46,6 +46,11 @@ def _on_close_callback(self, manager, result):
def cancel(self):
"""Stops pulling messages and shutdowns the background thread consuming
.. versionchanged:: 2.4.1
The method does not block anymore, it just triggers the shutdown and returns
immediately. To block until the background stream is terminated, call
:meth:`result()` after cancelling the future.
# NOTE: We circumvent the base future's self._state to track the cancellation
# state, as this state has different meaning with streaming pull futures.

0 comments on commit c825789

Please sign in to comment.