Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions samples/snippets/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def publish_messages_with_error_handler(project_id, topic_id):
def get_callback(publish_future, data):
def callback(publish_future):
try:
# Wait 100 ms for the publish call to succeed.
print(publish_future.result(timeout=0.1))
# Wait 60 seconds for the publish call to succeed.
print(publish_future.result(timeout=60))
except futures.TimeoutError:
print(f"Publishing {data} timed out.")

Expand Down Expand Up @@ -246,7 +246,8 @@ def callback(publish_future):
message_id = publish_future.result()
print(message_id)

# Publish 1000 messages in quick succession to trigger flow control.
# Publish 1000 messages in quick succession may be constrained by
# publisher flow control.
for n in range(1, 1000):
data = f"Message number {n}"
# Data must be a bytestring
Expand Down