Class ReliableStreamReader (4.0.0)

Stay organized with collections Save and categorize content based on your preferences.
public sealed class ReliableStreamReader : IDisposable

Provides streaming access to a Spanner SQL query that automatically retries, handles chunking and recoverable errors.

Inheritance

Object > ReliableStreamReader

Implements

IDisposable

Namespace

Google.Cloud.Spanner.V1

Assembly

Google.Cloud.Spanner.V1.dll

Properties

IsClosed

public bool IsClosed { get; }

Indicates whether the reader is closed or not.

Property Value
TypeDescription
Boolean

Stats

public ResultSetStats Stats { get; }

The statistics for the results, if present. These are only present on the last RPC response from the server. They can be observed while that final response is being consumed, or afterwards.

Property Value
TypeDescription
ResultSetStats

Methods

Close()

public void Close()

Closes the stream reader.

Dispose()

public void Dispose()

Finalize()

protected void Finalize()

GetMetadataAsync(CancellationToken)

public async Task<ResultSetMetadata> GetMetadataAsync(CancellationToken cancellationToken)

Asynchronously retrieves the metadata associated with this stream.

Parameter
NameDescription
cancellationTokenCancellationToken

A cancellation token for the asynchronous operation.

Returns
TypeDescription
Task<ResultSetMetadata>

A task which, when completed, will contain the metadata for the stream.

HasDataAsync(CancellationToken)

public async Task<bool> HasDataAsync(CancellationToken cancellationToken)

Determines whether this stream has any more data or not. This is equivalent to calling NextAsync(CancellationToken) to see whether the return value is null, but without consuming the value from the stream.

Parameter
NameDescription
cancellationTokenCancellationToken

A cancellation token for the asynchronous operation.

Returns
TypeDescription
Task<Boolean>

A task which, when completed, will indicate whether the stream contains data.

NextAsync(CancellationToken)

public async Task<Value> NextAsync(CancellationToken cancellationToken)

Asynchronously reads the next value from the stream. A null value indicates the end of the stream.

Parameter
NameDescription
cancellationTokenCancellationToken

A cancellation token for the asynchronous operation.

Returns
TypeDescription
Task<Value>

A task which, when completed, will provide the next value read from the stream.

Events

StreamClosed

public event EventHandler<StreamClosedEventArgs> StreamClosed

Event invoked when the stream is closed.

Event Type
TypeDescription
EventHandler<StreamClosedEventArgs>