Firestore API - Class FirestoreChangeListener (3.6.0)

public sealed class FirestoreChangeListener

Reference documentation and code samples for the Firestore API class FirestoreChangeListener.

An ongoing "listen" or "watch" operation on either document or query snapshots. This is returned from Listen methods.

Inheritance

object > FirestoreChangeListener

Namespace

Google.Cloud.Firestore

Assembly

Google.Cloud.Firestore.dll

Properties

ListenerTask

public Task ListenerTask { get; }

A task that will complete when the listen operation finishes.

Property Value
TypeDescription
Task
Remarks

If a cancellation token provided by the caller (either when starting to listen or when calling StopAsync(CancellationToken)) is canceled, the task will finish in a state of Canceled. The task will finish in a state of Faulted if any other kind of exception was thrown, including any non-retriable RPC exceptions. The task will finish in a state of RanToCompletion if the listener stopped gracefully.

Methods

StopAsync(CancellationToken)

public Task StopAsync(CancellationToken cancellationToken = default)

Requests that the client stops listening for changes. If a callback is in progress, that will be allowed to complete, but cancelling cancellationToken will cancel the token passed to the callback, allowing for prompt cancellation if required.

Parameter
NameDescription
cancellationTokenCancellationToken

A cancellation token to cancel a callback if one is in progress.

Returns
TypeDescription
Task

The task to indicate listener completion. This returns the same as ListenerTask.

Remarks

This method must only be called once per listener.