-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
#744: Add 'pubsub.message.Message' class #800
Conversation
- 'api._topic_from_resource' -> 'Topic.from_api_repr' - 'api._subscription_from_resource' -> 'Subscription.from_api_repr'
|
||
@property | ||
def attrs(self): | ||
"""Lazily-constructed attribute dictionary""" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
What's the necessity of a |
Mostly, the message has some behavior that differs from the raw mappings: base64-decoding the payload, for one. If we need to add support for timestamping / serial handling, then it gives us a place to hang it on the subscriber side. |
OK LGTM. I'm not sure I buy the savings of using |
Maps 'pubsub.v1beta2.PubsubMessage', handles base64-decode of payload. Return 'Message' instances from 'Subscription.pull()'. Update docs accordingly.
Squashed down to 2 commits. I will merge when Travis pulls its thumb out. |
Changes Unknown when pulling 6a5f480 on tseaver:744-pubsub-message_class into * on GoogleCloudPlatform:master*. |
#744: Add 'pubsub.message.Message' class
Also, convert factory helper functions for topics and subscriptions into
from_api_repr
class methods.