Class FirestoreChangeListener
An ongoing "listen" or "watch" operation on either document or query snapshots.
This is returned from Listen
methods.
Namespace: Google.Cloud.Firestore
Assembly: Google.Cloud.Firestore.dll
Syntax
public sealed class FirestoreChangeListener
Properties
ListenerTask
A task that will complete when the listen operation finishes.
Declaration
public Task ListenerTask { get; }
Property Value
Type | Description |
---|---|
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)
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.
Declaration
public Task StopAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | A cancellation token to cancel a callback if one is in progress. |
Returns
Type | Description |
---|---|
Task | The task to indicate listener completion. This returns the same as ListenerTask. |
Remarks
This method must only be called once per listener.