8000 Updated db.Reference.listen() documentation (#268) · alihen/firebase-admin-python@4aa3422 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4aa3422

Browse files
authored
Updated db.Reference.listen() documentation (firebase#268)
1 parent 32c34c6 commit 4aa3422

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

firebase_admin/db.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,11 @@ def listen(self, callback):
350350
"""Registers the ``callback`` function to receive realtime updates.
351351
352352
The specified callback function will get invoked with ``db.Event`` objects for each
353-
realtime update received from the database.
353+
realtime update received from the database. It will also get called whenever the SDK
354+
reconnects to the server due to network issues and credential expiration. In general,
355+
the OAuth2 credentials used to authorize connections to the server expire every hour.
356+
Therefore clients should expect the ``callback`` to fire at least once every hour, even if
357+
there are no updates in the database.
354358
355359
This API is based on the event streaming support available in the Firebase REST API. Each
356360
call to ``listen()`` starts a new HTTP connection and a background thread. This is an

0 commit comments

Comments
 (0)
0