Skip to content

Commit 64893b7

Browse files
luxianguplamut
authored andcommitted
Fix subscription.open get called twice in the client libraries [(#1321)](GoogleCloudPlatform/python-docs-samples#1321)
1 parent 464500f commit 64893b7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

samples/snippets/subscriber.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,8 @@ def callback(message):
124124

125125
# Blocks the thread while messages are coming in through the stream. Any
126126
# exceptions that crop up on the thread will be set on the future.
127-
future = subscription.open(callback)
128127
try:
129-
future.result()
128+
subscription.future.result()
130129
except Exception as e:
131130
print(
132131
'Listening for messages on {} threw an Exception: {}.'.format(

0 commit comments

Comments
 (0)