firebase:: database:: DisconnectionHandler
#include <disconnection.h>
Allows you to register server-side actions to occur when the client disconnects.
Summary
Each method you call (with the exception of Cancel) will queue up an action on the data that will be performed by the server in the event the client disconnects. To reset this queue, callCancel().
ADisconnectionHandler is associated with a specific location in the database, as they are obtained by callingDatabaseReference::OnDisconnect().
Constructors and Destructors | |
|---|---|
~DisconnectionHandler() |
Public functions | |
|---|---|
Cancel() | Future< void >Cancel any Disconnection operations that are queued up by this handler. |
CancelLastResult() | Future< void >Get the result of the most recent call toCancel(). |
RemoveValue() | Future< void >Remove the value at the current location when the client disconnects. |
RemoveValueLastResult() | Future< void >Get the result of the most recent call toRemoveValue(). |
SetValue(Variant value) | Future< void >Set the value of the data at the current location when the client disconnects. |
SetValueAndPriority(Variant value,Variant priority) | Future< void >Set the value and priority of the data at the current location when the client disconnects. |
SetValueAndPriorityLastResult() | Future< void >Get the result of the most recent call toSetValueAndPriority(). |
SetValueLastResult() | Future< void >Get the result of the most recent call toSetValue(). |
UpdateChildren(Variant values) | Future< void >Updates the specified child keys to the given values when the client disconnects. |
UpdateChildren(const std::map< std::string,Variant > & values) | Future< void >Updates the specified child keys to the given values when the client disconnects. |
UpdateChildrenLastResult() | Future< void >Gets the result of the most recent call to either version ofUpdateChildren(). |
Public functions
Cancel
Future<void>Cancel()
Cancel any Disconnection operations that are queued up by this handler.
When theFuture returns, if its Error is kErrorNone, the queue has been cleared on the server.
| Details | |
|---|---|
| Returns |
CancelLastResult
Future<void>CancelLastResult()
RemoveValue
Future<void>RemoveValue()
Remove the value at the current location when the client disconnects.
When theFuture returns, if its Error is kErrorNone, the RemoveValue operation has been successfully queued up on the server.
| Details | |
|---|---|
| Returns |
RemoveValueLastResult
Future<void>RemoveValueLastResult()
Get the result of the most recent call toRemoveValue().
| Details | |
|---|---|
| Returns | Result of the most recent call toRemoveValue(). |
SetValue
Future<void>SetValue(Variantvalue)
Set the value of the data at the current location when the client disconnects.
When theFuture returns, if its Error is kErrorNone, the SetValue operation has been successfully queued up on the server.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns |
SetValueAndPriority
Future<void>SetValueAndPriority(Variantvalue,Variantpriority)
Set the value and priority of the data at the current location when the client disconnects.
When theFuture returns, if its Error is kErrorNone, the SetValue operation has been successfully queued up on the server.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
| ||||
| Returns |
SetValueAndPriorityLastResult
Future<void>SetValueAndPriorityLastResult()
Get the result of the most recent call toSetValueAndPriority().
| Details | |
|---|---|
| Returns | Result of the most recent call toSetValueAndPriority(). |
SetValueLastResult
Future<void>SetValueLastResult()
Get the result of the most recent call toSetValue().
| Details | |
|---|---|
| Returns | Result of the most recent call toSetValue(). |
UpdateChildren
Future<void>UpdateChildren(Variantvalues)
Updates the specified child keys to the given values when the client disconnects.
When theFuture returns, if its Error is kErrorNone, the UpdateChildren operation has been successfully queued up by the server.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns |
UpdateChildren
Future<void>UpdateChildren(conststd::map<std::string,Variant>&values)
Updates the specified child keys to the given values when the client disconnects.
When theFuture returns, if its Error is kErrorNone, the UpdateChildren operation has been successfully queued up by the server.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns |
UpdateChildrenLastResult
Future<void>UpdateChildrenLastResult()
Gets the result of the most recent call to either version ofUpdateChildren().
| Details | |
|---|---|
| Returns | Result of the most recent call toUpdateChildren(). |
~DisconnectionHandler
~DisconnectionHandler()
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-01-23 UTC.