Skip to content

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Jun 6, 2015

  • It doesn't seem that in pub/sub there was ever a use of _LocalStack so the worries about the welded on client and batching don't seem to manifest in the pubsub subpackage.
  • I tried to make the commits as small and reviewable as possible.
  • I'm happy to split this up into many PRs to make review / commenting easier.
  • The Using client on all Topic methods. and Using 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.
  • I didn't look too closely, but there may be some superfluous connection vs. client tests that exist as artifacts of the old / transition states of the code.

dhermes added 12 commits June 5, 2015 15:25
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.
@dhermes dhermes added the api: pubsub Issues related to the Pub/Sub API. label Jun 6, 2015
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 6, 2015
>>> 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.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@dhermes dhermes force-pushed the pubsub-client-approach branch 2 times, most recently from 838392f to 4d723d9 Compare June 6, 2015 16:55

- 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.

"""
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.

This comment was marked as spam.

@jgeewax
Copy link
Contributor

jgeewax commented Jun 6, 2015

Awesome @dhermes . This LGTM but I think it may be worthwhile to have @tseaver take a look too.....

@dhermes
Copy link
Contributor Author

dhermes commented Jun 9, 2015

@tseaver You all done with your review?

@tseaver
Copy link
Contributor

tseaver commented Jun 9, 2015

Yup