Uh oh!
There was an error while loading. Please reload this page.
Add operation future - #3618
Conversation
| Args: | ||
| operation (dict): Operation as a dictionary. | ||
| api_request (Callable): A callable used to make an API request. This |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
lukesneeringer
left a comment
There was a problem hiding this comment.
This seems fine to me. No issues adding tenacity.
dhermes
left a comment
There was a problem hiding this comment.
High-level: Do LRO RPC services give trailers describing when to retry?
| 'google-auth >= 0.4.0, < 2.0.0dev', | ||
| 'google-auth-httplib2', | ||
| 'six', | ||
| 'tenacity >= 4.0.0, <5.0.0dev' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| """Abstract and helper bases for Future implementations.""" | ||
| import abc | ||
| import concurrent.futures |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| The private :meth:`_blocking_poll` method should be implemented by | ||
| subclasses. | ||
| The private :meth:`done` method should be implemented by |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| """ | ||
| # pylint: disable=missing-raises | ||
| raise NotImplementedError() | ||
| if self._result_set: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| if self._result_set: | ||
| return | ||
| retry_on = tenacity.retry_if_result(lambda result: result is not True) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| self.set_exception(exception) | ||
| else: | ||
| exception = exceptions.GoogleCloudError( | ||
| 'Unknown operation error') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| bool: True if the operation is complete, False otherwise. | ||
| """ | ||
| operation = self._refresh_and_update() | ||
| return operation.done |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| Args: | ||
| operation (dict): Operation as a dictionary. | ||
| api_request (Callable): A callable used to make an API request. This |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| Args: | ||
| operation (dict): Operation as a dictionary. | ||
| api_request (Callable): A callable used to make an API request. This | ||
| should generally be an instance of |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| to a given API) vis `HTTP/JSON`_. | ||
| .. _HTTP/JSON: https://cloud.google.com/speech/reference/rest/\ | ||
| v1beta1/operations#Operation |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| exception = exceptions.GoogleCloudError( | ||
| 'Unknown operation error') | ||
| 'Unexpected state: Long-running operation had neither ' | ||
| 'response nor error set.') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
theacodes
commented
Jul 18, 2017
@dhermes the latest release of resumable-media seems to have broken circle. Do you want me to hold off on merging this until you can resolve that? (Master will be broken by it either way). |
theacodes
commented
Jul 19, 2017
Rebased and waiting on CI to merge. |
Note: This adds a dependency on the
tenacitylibrary. It's worth it.Towards #3617