File tree Expand file tree Collapse file tree
packages/google-cloud-pubsub/samples/snippets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,8 +150,8 @@ def publish_messages_with_error_handler(project_id, topic_id):
150150 def get_callback (publish_future , data ):
151151 def callback (publish_future ):
152152 try :
153- # Wait 100 ms for the publish call to succeed.
154- print (publish_future .result (timeout = 0.1 ))
153+ # Wait 60 seconds for the publish call to succeed.
154+ print (publish_future .result (timeout = 60 ))
155155 except futures .TimeoutError :
156156 print (f"Publishing { data } timed out." )
157157
@@ -246,7 +246,8 @@ def callback(publish_future):
246246 message_id = publish_future .result ()
247247 print (message_id )
248248
249- # Publish 1000 messages in quick succession to trigger flow control.
249+ # Publish 1000 messages in quick succession may be constrained by
250+ # publisher flow control.
250251 for n in range (1 , 1000 ):
251252 data = f"Message number { n } "
252253 # Data must be a bytestring
You can’t perform that action at this time.
0 commit comments