Skip to content
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.

Update to support bundling #28

Merged
merged 1 commit into from
Feb 25, 2016
Merged

Update to support bundling #28

merged 1 commit into from
Feb 25, 2016

Conversation

geigerj
Copy link
Contributor

@geigerj geigerj commented Feb 24, 2016

Provides access to bundling through ApiCallable. Replaces
ApiCallDefaults with CallSettings, which corresponds to a change
in the code generation to pass bundling settings through to
ApiCallable.

Provides access to bundling through ApiCallable. Replaces
ApiCallDefaults with CallSettings, which corresponds to a change
in the code generation to pass bundling settings through to
ApiCallable.
the_func = _add_timeout_arg(the_func, timeout)
the_func = _add_timeout_arg(the_func, self.settings.timeout)
if self.settings.bundler and self.settings.bundle_descriptor:
the_func = _bundleable(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N.B: At this point, _bundleable is called with the_func which is still a callable([[request], response])
I refer to this in another comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We start out with (if you'll forgive some haskell-ish notation):
the_func :: (RequestType, int) -> (ResponseType)
_add_timeout_arg :: ((type_1, ..., type_n, int) -> X), int) -> (type_1, ..., type_n) -> X

hence,
_add_timeout_arg(the_func) :: RequestType -> ResponseType

So I think in test_api_callable, my_func must take a dummy_timeout, or else we can't meaningfully apply _add_timeout_arg to it in ApiCallable. Does that sounds right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes sense, LGTM

@tbetbetbe
Copy link
Contributor

LGTM

geigerj added a commit that referenced this pull request Feb 25, 2016
Update to support bundling
@geigerj geigerj merged commit 6ae1e45 into googleapis:master Feb 25, 2016
bjwatson pushed a commit to googleapis/gapic-generator that referenced this pull request Apr 20, 2016
Introduces bundling into Python VGen. To accomodate bundling, the
defaults/options system has been reworked; ApiCallDefaults is removed.
Instead, a dictionary is maintained which associates defaults to each
method; the values in the dictionary are then merged with any
CallOptions passed in while a call is being made.

A corresponding change to GAX is here:
  googleapis/gax-python#28

Note that it is not currently possible to override the bundling
defaults when calling the API constructor; a later change will add
the ability to pass in a dictionary mapping method names to bundlers
in order to provide this functionality.

Change-Id: I434a6026882fa57ec0d4672bff8be4f4102c4a82
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants