Skip to content

Removing most (direct) connection usage in Pub / Sub - #2874

Merged
dhermes merged 3 commits into
googleapis:masterfrom
dhermes:gax-ignore-connection
Dec 16, 2016
Merged

Removing most (direct) connection usage in Pub / Sub#2874
dhermes merged 3 commits into
googleapis:masterfrom
dhermes:gax-ignore-connection

Conversation

@dhermes

@dhermesdhermes commented Dec 15, 2016

Copy link
Copy Markdown
Contributor

NOTE: Has #2870 as diffbase.

@dhermesdhermes added hygiene api: pubsub Issues related to the Pub/Sub API. labels Dec 15, 2016
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 15, 2016
@daspecsterdaspecster mentioned this pull request Dec 15, 2016
Comment threadpubsub/unit_tests/test__gax.py Outdated
insecure_channel=mock_insecure_channel)
with patch:
result = self._call_fut(connection)
result = self._call_fut(None, host=host, secure=False)

This comment was marked as spam.

This comment was marked as spam.

@tseaver

Copy link
Copy Markdown
Contributor

@dhermes I'm OK to merge without the change I suggested, if you don't think it would be an improvement.

@dhermes
dhermesforce-pushed the gax-ignore-connection branch from 201fce2 to c8a0d6eCompareDecember 15, 2016 20:33
@dhermes

Copy link
Copy Markdown
ContributorAuthor

@tseaver WDYT of my most recent comment above

@tseaver

Copy link
Copy Markdown
Contributor

@dhermes It looks to me as though host unused in the non-emulated case. If so, then the call site becomes:

ifself.conn.in_emul:
channel=make_foo(host=emulator_host)
else:
channel=make_foo(credentials=credentials)

Still using a method of a connection object, but this way
it can be more easily swapped out for a function defined
in that module doing the same task.
@dhermes
dhermesforce-pushed the gax-ignore-connection branch from c8a0d6e to 80413c5CompareDecember 16, 2016 06:27
@dhermes
dhermesforce-pushed the gax-ignore-connection branch from 80413c5 to a46184cCompareDecember 16, 2016 06:37
@dhermes

Copy link
Copy Markdown
ContributorAuthor

@tseaver PTAL

@tseaver

Copy link
Copy Markdown
Contributor

LGTM

@dhermes
dhermes merged commit 3d354dc into googleapis:masterDec 16, 2016
@dhermes
dhermes deleted the gax-ignore-connection branch December 16, 2016 18:18
This was referenced Dec 29, 2016
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
Removing most (direct) connection usage in Pub / Sub
parthea pushed a commit that referenced this pull request Mar 2, 2026
Removing most (direct) connection usage in Pub / Sub
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsubIssues related to the Pub/Sub API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@dhermes@tseaver@daspecster@googlebot