Stay organized with collections
Save and categorize content based on your preferences.
Firebase.Firestore.ListenerRegistration
Represents a listener for either document or query snapshots that is returned from Listen
methods.
Summary
The listener can be removed by calling ListenerRegistration.Stop.
Inheritance
Inherits from: IDisposable
Properties
|
ListenerTask
|
Task
A task that will complete when the listen operation finishes.
|
Properties
ListenerTask
Task ListenerTask
A task that will complete when the listen operation finishes.
The task will finish in a state of TaskStatus.Faulted
if any kind of exception was thrown, including any non-retriable RPC exceptions. The task will finish in a state of TaskStatus.RanToCompletion"
if the listener stopped gracefully.
Public functions
Dispose
void Dispose()
Calls the Stop() method.
Note that this method is not invoked by the destructor. This is intentional as this class does not handle unmanaged resources. The usage of the IDisposable interface does however enable using this class with external reactive libraries that expect it.
Stop
void Stop()
Removes the listener being tracked by this ListenerRegistration
.
If ListenerTask is not completed, then it will transition to the TaskStatus.RanToCompletion"
state. After the initial call of this method, subsequent calls have no effect.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-07-27 UTC.
[null,null,["Last updated 2022-07-27 UTC."],[],[],null,["# Firebase.Firestore.ListenerRegistration Class Reference\n\nFirebase.Firestore.ListenerRegistration\n=======================================\n\nRepresents a listener for either document or query snapshots that is returned from `Listen` methods.\n\nSummary\n-------\n\nThe listener can be removed by calling [ListenerRegistration.Stop](/docs/reference/unity/class/firebase/firestore/listener-registration#class_firebase_1_1_firestore_1_1_listener_registration_1a6c7f69812ca19b3acfeed3668d9b4655).\n\n### Inheritance\n\nInherits from: IDisposable\n\n| ### Properties ||\n|------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|\n| [ListenerTask](#class_firebase_1_1_firestore_1_1_listener_registration_1aafd6719cda4c067ce42429b4c9af55f1) | `Task` A task that will complete when the listen operation finishes. |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Dispose](#class_firebase_1_1_firestore_1_1_listener_registration_1a4aba914d3acc380ca718ae0a42c9b237)`()` | `void` Calls the [Stop()](/docs/reference/unity/class/firebase/firestore/listener-registration#class_firebase_1_1_firestore_1_1_listener_registration_1a6c7f69812ca19b3acfeed3668d9b4655) method. |\n| [Stop](#class_firebase_1_1_firestore_1_1_listener_registration_1a6c7f69812ca19b3acfeed3668d9b4655)`()` | `void` Removes the listener being tracked by this [ListenerRegistration](/docs/reference/unity/class/firebase/firestore/listener-registration#class_firebase_1_1_firestore_1_1_listener_registration). |\n\nProperties\n----------\n\n### ListenerTask\n\n```c#\nTask ListenerTask\n``` \nA task that will complete when the listen operation finishes.\n\nThe task will finish in a state of `TaskStatus.Faulted` if any kind of exception was thrown, including any non-retriable RPC exceptions. The task will finish in a state of `TaskStatus.RanToCompletion\"` if the listener stopped gracefully.\n\nPublic functions\n----------------\n\n### Dispose\n\n```c#\nvoid Dispose()\n``` \nCalls the [Stop()](/docs/reference/unity/class/firebase/firestore/listener-registration#class_firebase_1_1_firestore_1_1_listener_registration_1a6c7f69812ca19b3acfeed3668d9b4655) method.\n\nNote that this method is *not* invoked by the destructor. This is intentional as this class does not handle unmanaged resources. The usage of the IDisposable interface does however enable using this class with external reactive libraries that expect it. \n\n### Stop\n\n```c#\nvoid Stop()\n``` \nRemoves the listener being tracked by this [ListenerRegistration](/docs/reference/unity/class/firebase/firestore/listener-registration#class_firebase_1_1_firestore_1_1_listener_registration).\n\nIf [ListenerTask](/docs/reference/unity/class/firebase/firestore/listener-registration#class_firebase_1_1_firestore_1_1_listener_registration_1aafd6719cda4c067ce42429b4c9af55f1) is not completed, then it will transition to the `TaskStatus.RanToCompletion\"` state. After the initial call of this method, subsequent calls have no effect."]]