| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
|
||
| Args: | ||
| operation (dict): Operation as a dictionary. | ||
| api_request (Callable): A callable used to make an API request. This |
There was a problem hiding this comment.
This seems fine to me. No issues adding tenacity.
Sorry, something went wrong.
There was a problem hiding this comment.
High-level: Do LRO RPC services give trailers describing when to retry?
Sorry, something went wrong.
| 'google-auth >= 0.4.0, < 2.0.0dev', | ||
| 'google-auth-httplib2', | ||
| 'six', | ||
| 'tenacity >= 4.0.0, <5.0.0dev' |
| """Abstract and helper bases for Future implementations.""" | ||
|
|
||
| import abc | ||
| import concurrent.futures |
|
|
||
| The private :meth:`_blocking_poll` method should be implemented by | ||
| subclasses. | ||
| The private :meth:`done` method should be implemented by |
| """ | ||
| # pylint: disable=missing-raises | ||
| raise NotImplementedError() | ||
| if self._result_set: |
| if self._result_set: | ||
| return | ||
|
|
||
| retry_on = tenacity.retry_if_result(lambda result: result is not True) |
| self.set_exception(exception) | ||
| else: | ||
| exception = exceptions.GoogleCloudError( | ||
| 'Unknown operation error') |
| bool: True if the operation is complete, False otherwise. | ||
| """ | ||
| operation = self._refresh_and_update() | ||
| return operation.done |
|
|
||
| Args: | ||
| operation (dict): Operation as a dictionary. | ||
| api_request (Callable): A callable used to make an API request. This |
| 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 |
| to a given API) vis `HTTP/JSON`_. | ||
|
|
||
| .. _HTTP/JSON: https://cloud.google.com/speech/reference/rest/\ | ||
| v1beta1/operations#Operation |
| exception = exceptions.GoogleCloudError( | ||
| 'Unknown operation error') | ||
| 'Unexpected state: Long-running operation had neither ' | ||
| 'response nor error set.') |
|
@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). |
Sorry, something went wrong.
|
Rebased and waiting on CI to merge. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Note: This adds a dependency on the tenacity library. It's worth it.
Towards #3617