Skip to content

Conversation

@tseaver
Copy link
Contributor

@tseaver tseaver commented Apr 28, 2016

In response to #1756.

Tweaking pubsub snippets to ensure that running them actually passes:

  • Dropping a long-hanging example, never pulled into the Sphinx docs.
  • Adding a time.sleep(1) between the last topic.publish call and the subscription.pull.

Also, fixes a bug exposed by running the snippets: the API object's subscription_pull method was not tolerant of an empty response.

@tseaver tseaver added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. docs testing api: pubsub Issues related to the Pub/Sub API. labels Apr 28, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 28, 2016
@tseaver
Copy link
Contributor Author

tseaver commented Apr 28, 2016

@dhermes PTAL


# [START subscription_pull_none_pending]
pulled = subscription.pull(max_messages=1)
# [END subscription_pull_none_pending]

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Apr 28, 2016

@tseaver This doesn't change any docs, so it's only loosely related to #1756 right?

LGTM anyhow (except for the spelling error).

@tseaver
Copy link
Contributor Author

tseaver commented Apr 28, 2016

@dhermes these changes are all things I found while investigating #1756.

@tseaver tseaver merged commit 023f316 into googleapis:master Apr 28, 2016
@tseaver tseaver deleted the 1756-pubsub-snippet_fixup branch April 28, 2016 15:27
@tseaver tseaver mentioned this pull request May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API. cla: yes This human has signed the Contributor License Agreement. testing type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants