Class AppendRowsStream (2.11.0)

AppendRowsStream(
    client: google.cloud.bigquery_storage_v1beta2.services.big_query_write.client.BigQueryWriteClient,
    initial_request_template: google.cloud.bigquery_storage_v1beta2.types.storage.AppendRowsRequest,
    metadata: Sequence[Tuple[str, str]] = (),
)

A manager object which can append rows to a stream.

Properties

is_active

bool: True if this manager is actively streaming.

Note that False does not indicate this is complete shut down, just that it stopped getting new messages.

Methods

AppendRowsStream

AppendRowsStream(
    client: google.cloud.bigquery_storage_v1beta2.services.big_query_write.client.BigQueryWriteClient,
    initial_request_template: google.cloud.bigquery_storage_v1beta2.types.storage.AppendRowsRequest,
    metadata: Sequence[Tuple[str, str]] = (),
)

Construct a stream manager.

add_close_callback

add_close_callback(callback: Callable)

Schedules a callable when the manager closes.

Parameter
NameDescription
callback Callable

The method to call.

close

close(reason: Optional[Exception] = None)

Stop consuming messages and shutdown all helper threads.

This method is idempotent. Additional calls will have no effect.

send

send(
    request: google.cloud.bigquery_storage_v1beta2.types.storage.AppendRowsRequest,
)

Send an append rows request to the open stream.