Does Firebase have a timeout policy for write operations?

There is setValue( )to save data in Firebase. What happens if the connection is very slow. Is there a timeout limit for saving data? If he does time out, does he repeat? If he repeats, how many times?

Also, is there a timeout for the read method onDataChange(DataSnapshot snapshot)and update methods?

Is there a way to set my own timeout limits?

+4
source share
1 answer

When the client first connects to Firebase (therefore, when it first executes new Firebase(...), it establishes a connection to the WebSocket server, after which all data is transmitted over this pre-established connection.

When you call setValue()or another write operation, the command is sent through an open socket to the server. When a client adds a listener (with addValueEventListener()or similar), the server will send updates through an open socket to your client. Since the connection is not established, timeouts do not really play here.

When the connection between the client and server is somehow lost, the client will try to reconnect. Here it uses exponential rollback, so initially it often tries to reconnect and gradually less often.

, , , ( , ). . ( , , onDataChange()) , .

. , , (Firebase.getDefaultConfig().setLogLevel(Level.DEBUG) Android) , . , - .

+7

Source: https://habr.com/ru/post/1624566/


All Articles