diff --git a/google/cloud/pubsub_v1/subscriber/futures.py b/google/cloud/pubsub_v1/subscriber/futures.py index 97a911076..18298b956 100644 --- a/google/cloud/pubsub_v1/subscriber/futures.py +++ b/google/cloud/pubsub_v1/subscriber/futures.py @@ -46,6 +46,11 @@ def _on_close_callback(self, manager, result): def cancel(self): """Stops pulling messages and shutdowns the background thread consuming messages. + + .. 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.