As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit
Python 2 support on Google Cloud.
Long-Running Operations¶Futures for long-running operations returned from Google Cloud APIs.
These futures can be used to synchronously wait for the result of a long-running operation using Operation.result()
:
operation = my_api_client.long_running_method() result = operation.result()
Or asynchronously using callbacks and Operation.add_done_callback()
:
operation = my_api_client.long_running_method() def my_callback(future): result = future.result() operation.add_done_callback(my_callback)
Bases: google.api_core.future.polling.PollingFuture
A Future for interacting with a Google API Long-Running Operation.
operation (google.longrunning.operations_pb2.Operation) – The initial operation.
refresh (Callable[[], Operation]) – A callable that returns the latest state of the operation.
cancel (Callable[[], None]) – A callable that tries to cancel the operation.
(func (metadata_type) – type): The protobuf type for the operation’s result.
(func – type): The protobuf type for the operation’s metadata.
polling (google.api_core.retry.Retry) – The configuration used for polling. This parameter controls how often done()
is polled. If the timeout
argument is specified in the result()
method, it will override the polling.timeout
property.
retry (google.api_core.retry.Retry) – DEPRECATED: use polling
instead. If specified it will override polling
parameter to maintain backward compatibility.
Attempt to cancel the operation.
already complete.
True if the operation was cancelled.
Deserialize a google.longrunning.Operation
protocol buffer.
payload (bytes) – A serialized operation protocol buffer.
An Operation protobuf object.
Operation
Checks to see if the operation is complete.
retry (google.api_core.retry.Retry) – (Optional) How to retry the RPC.
True if the operation is complete, False otherwise.
the current operation metadata.
google.protobuf.Message
The current long-running operation.
google.longrunning.Operation
Create an operation future from a gapic client.
This interacts with the long-running operations service (specific to a given API) via a gapic client.
operation (google.longrunning.operations_pb2.Operation) – The operation.
operations_client (google.api_core.operations_v1.OperationsClient) – The operations client.
result_type (type()
) – The protobuf result type.
grpc_metadata (Optional[List[Tuple[str, str]]]) – Additional metadata to pass to the rpc.
kwargs – Keyword args passed into the Operation
constructor.
operation.
Operation
Create an operation future using a gRPC client.
This interacts with the long-running operations service (specific to a given API) via gRPC.
operation (google.longrunning.operations_pb2.Operation) – The operation.
operations_stub (google.longrunning.operations_pb2.OperationsStub) – The operations stub.
result_type (type()
) – The protobuf result type.
grpc_metadata (Optional[List[Tuple[str, str]]]) – Additional metadata to pass to the rpc.
kwargs – Keyword args passed into the Operation
constructor.
operation.
Operation
Create an operation future using a HTTP/JSON client.
This interacts with the long-running operations service (specific to a given API) via HTTP/JSON.
operation.
Operation
AsyncIO futures for long-running operations returned from Google Cloud APIs.
These futures can be used to await for the result of a long-running operation using AsyncOperation.result()
:
operation = my_api_client.long_running_method() result = await operation.result()
Or asynchronously using callbacks and Operation.add_done_callback()
:
operation = my_api_client.long_running_method() def my_callback(future): result = await future.result() operation.add_done_callback(my_callback)
Bases: google.api_core.future.async_future.AsyncFuture
A Future for interacting with a Google API Long-Running Operation.
operation (google.longrunning.operations_pb2.Operation) – The initial operation.
refresh (Callable[[], Operation]) – A callable that returns the latest state of the operation.
cancel (Callable[[], None]) – A callable that tries to cancel the operation.
(func (metadata_type) – type): The protobuf type for the operation’s result.
(func – type): The protobuf type for the operation’s metadata.
retry (google.api_core.retry.Retry) – The retry configuration used when polling. This can be used to control how often done()
is polled. Regardless of the retry’s deadline
, it will be overridden by the timeout
argument to result()
.
Attempt to cancel the operation.
already complete.
True if the operation was cancelled.
Deserialize a google.longrunning.Operation
protocol buffer.
payload (bytes) – A serialized operation protocol buffer.
An Operation protobuf object.
Operation
Checks to see if the operation is complete.
retry (google.api_core.retry.Retry) – (Optional) How to retry the RPC.
True if the operation is complete, False otherwise.
the current operation metadata.
google.protobuf.Message
The current long-running operation.
google.longrunning.Operation
Create an operation future from a gapic client.
This interacts with the long-running operations service (specific to a given API) via a gapic client.
operation (google.longrunning.operations_pb2.Operation) – The operation.
operations_client (google.api_core.operations_v1.OperationsClient) – The operations client.
result_type (type()
) – The protobuf result type.
grpc_metadata (Optional[List[Tuple[str, str]]]) – Additional metadata to pass to the rpc.
kwargs – Keyword args passed into the Operation
constructor.
operation.
Operation
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4