Setting priority only in Firebase's onDisconnect()

In Firebase's onDisconnect() handler, you can easily use setValue() to update the reference to another value or remove() to delete that reference.

For setValue(), there are also variants that include the priority value.

But what is the best practice if you want to update the priority value only, and not the value?

Something like onDisconnect().setPriority(Double.MAX_VALUE) seems to be missing.

Manually getting the current value at the given reference again and passing this value to setValue() is not only too complicated but also not possible as a last, fast action when the user has disconnected.


onDisconnect() cannot even be used with onDisconnect().removeValue() or onDisconnect().setValue(null) at all. The problem is that you cannot disconnect the user manually, can you? This cannot be the optimal solution: As it is now, you have to wait for Java's GC to clear all the Firebase references, and hopefully then, at least, the connection will be closed so that the onDisconnect() callbacks will be fired, won't it?


There is no setPriority() for onDisconnect() at this time.

However, Firebase has mentioned their intention to add this feature in a future release, "Yes, we do intend to add this in the future! No ETA at this time."

Need Your Help

The advantage of Arc over Racket

lisp racket arc-lisp

Arc is built on top of Racket. Since both of them are in the Lisp family, I am curious about the the advantage of Arc over Racket, or what is the motivation of creating Arc given that Racket is