Class AppendRowsFuture (2.14.0)

AppendRowsFuture(
    manager: google.cloud.bigquery_storage_v1beta2.writer.AppendRowsStream,
)

Encapsulation of the asynchronous execution of an action.

This object is returned from long-running BigQuery Storage API calls, and is the interface to determine the status of those calls.

This object should not be created directly, but is returned by other methods in this library.

Inheritance

builtins.object > google.api_core.future.base.Future > google.api_core.future.polling.PollingFuture > AppendRowsFuture

Methods

add_done_callback

add_done_callback(fn)

Add a callback to be executed when the operation is complete.

If the operation is not already complete, this will start a helper thread to poll for the status of the operation in the background.

Parameter
NameDescription
fn Callable[Future]

The callback to execute when the operation is complete.

cancel

cancel()

Stops pulling messages and shutdowns the background thread consuming messages.

The method does not block, it just triggers the shutdown and returns immediately. To block until the background stream is terminated, call result() after cancelling the future.

cancelled

cancelled()
Returns
TypeDescription
bool``True`` if the write stream has been cancelled.

done

done(retry: Optional[google.api_core.retry.Retry] = None)

Check the status of the future.

exception

exception(timeout=None)

Get the exception from the operation, blocking if necessary.

Parameter
NameDescription
timeout int

How long to wait for the operation to complete. If None, wait indefinitely.

Returns
TypeDescription
Optional[google.api_core.GoogleAPICallError]The operation's error.

result

result(timeout=None, retry=<google.api_core.retry.Retry object>)

Get the result of the operation, blocking if necessary.

Parameter
NameDescription
timeout int

How long (in seconds) to wait for the operation to complete. If None, wait indefinitely.

Exceptions
TypeDescription
google.api_core.GoogleAPICallErrorIf the operation errors or if the timeout is reached before the operation completes.
Returns
TypeDescription
google.protobuf.MessageThe Operation's result.

running

running()

True if the operation is currently running.

set_exception

set_exception(exception)

Set the result of the future as being the given exception.

Do not use this method, it should only be used internally by the library and its unit tests.

set_result

set_result(result)

Set the return value of work associated with the future.

Do not use this method, it should only be used internally by the library and its unit tests.