-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,17 +162,23 @@ def topic_publish(self, topic_path, messages): | |
:raises: :exc:`gcloud.exceptions.NotFound` if the topic does not | ||
exist | ||
""" | ||
options = CallOptions(is_bundling=False) | ||
options = CallOptions(is_bundling=True) | ||
message_pbs = [_message_pb_from_dict(message) | ||
for message in messages] | ||
try: | ||
result = self._gax_api.publish(topic_path, message_pbs, | ||
options=options) | ||
# result = self._gax_api.publish(topic_path, message_pbs, | ||
# options=options) | ||
|
||
event = self._gax_api.publish(topic_path, message_pbs, | ||
options=options) | ||
if not event.is_set(): | ||
event.wait() | ||
This comment has been minimized.
Sorry, something went wrong.
bjwatson
|
||
except GaxError as exc: | ||
if exc_to_code(exc.cause) == StatusCode.NOT_FOUND: | ||
raise NotFound(topic_path) | ||
raise | ||
return result.message_ids | ||
# return result.message_ids | ||
return event.result.message_ids | ||
|
||
def topic_list_subscriptions(self, topic_path, page_size=0, | ||
page_token=None): | ||
|
This might not be needed if the commented-out code below is re-enabled.