-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Attempt at implementing clients for Pub/Sub #910
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
Conversation
Allows implicit determination of project and credentials if no values are passed.
Also moving Topic.client -> Topic._client since it should not (maybe?) be user facing. Also ditching use of actual Client class in test_topic and just using a mock (this simplifes things a bit).
This is so that it can be passed through to the parent topic created with the subscription.
In particular, in the Topic constructor and in Topic.from_api_repr and Subscription.from_api_repr.
Ditching use of connection since client already contains this information.
Ditching use of connection since client already contains this information.
>>> topic = Topic('topic_name') | ||
>>> from gcloud import pubsub | ||
>>> client = pubsub.Client() | ||
>>> topic = client.topic('topic_name') |
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.
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.
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.
838392f
to
4d723d9
Compare
|
||
- credentials (derived from GAE / GCE environ if present). | ||
- :class:`Client <gcloud.pubsub.client.Client>` objects hold both a ``project`` | ||
and an authenticated connection |
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.
""" | ||
def __init__(self, project=None, credentials=None, http=None): | ||
if project is None: | ||
project = _get_production_project() |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
4d723d9
to
29f35d0
Compare
@tseaver You all done with your review? |
Yup |
_LocalStack
so the worries about the welded on client and batching don't seem to manifest in thepubsub
subpackage.Using client on all Topic methods.
andUsing client on all Subscription methods.
commits are a bit longer than the rest. I'm also happy to break them up method-by-method if it makes review easier.