-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes for feedback from the Pub/Sub team #192
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Calling a message's attributes should give you a hash, so you can ask for the keys or iterate over the values. The code was returning the Google API Client object, which wraps the hash but does not have all the hash methods. Convert the object to a hash using to_hash. Ruby 1.9.3 does not have Hash#to_hash, so guard against that.
The documentation made it seem the default behavior was to not return immediately. Update documentation to match the current behavior.
a5b88ad
to
7726c37
Compare
It was possible that waiting for a pull request to finish would lead to an HTTP timeout error. Catch the errors and return an empty list instead. Forced to disable rubocop because none of the lines in pull are at a different level of abstraction. No obvious choice to extract methods. It would be more confusing to break the method up.
This is analogous to calling Subscription#pull immediate: true. Added for syntactical sugar. Update documentation to use wait_for_messages.
The variable was copy/pasted and raises a warning. Remove it.
This option will acknowledge messages as they are pulled. This is for convenience at the cost of possibly losing a message that is acknowledged before it can be processed. Beware...
Long polling messages, runs in an infinite loop.
Not every error returned has status, code, and errors in the response. Guard against this by raising Gcloud::Pubsub::Error with response attr. We want to avoid unhandled errors while raising a typed error. :)
The Google Cloud docs state that subscriptions can be created without a name, and that a name will be generated in such cases. However, we cannot create subscriptions without a name using Google API Client. Remove the option to subscribe without a name until this is supported. [refs googleapis#193]
We want to allow Pub/Sub topic objects to reference topics in a different project. We allow this by passing in the full path, but we also want to allow the following syntax: pubsub.topic topic-name, project: another-project-id We implemented this optional parameter when creating full paths for project, topic, and subscription, although they are not documented. They are there when/if we need it.
Expose the getIamPolicy and setIamPolicy endpoints. There is no official documentation for these endpoints yet, so this implementation is intentionally vague. But this is important functionality and needs to be here.
LGTM for docs |
@remi Thoughts? We'd like to get this released soon. :) |
We will consider this is good to go and accept it so we can cut a new release. |
quartzmo
added a commit
that referenced
this pull request
Jul 22, 2015
Additional Pub/Sub changes These changes are based on feedback from the Pub/Sub team. [closes #58]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make changes requested by the Pub/Sub team during their review. #58
Message#attributes
returns a Hash (and not a Google API Client object)Topic#pull
should return immediately by defaultSubscription#wait_for_messages
alias forpull immediate: false
Subscription#pull autoack: true
)Subscription#listen
codepubsub.topic "name", project: "project-id"
)Topic#policy
andTopic#policy=
code/docsSubscription#policy
andSubscription#policy=
code/docs