如何限制Firebase Android上的并发连接 [英] How to limit concurrent connections on Firebase Android

查看:107
本文介绍了如何限制Firebase Android上的并发连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能不是那个地方,但是在Firebase的网站上,似乎在这里问是可以接受的。
在他们的自由计划中,同时连接的设备数量不能超过100台,而使用 AddValueEventListener()函数你仍然更新实时。

我想要做的只是从数据库中请求一些数据,并让用户滚动,并获得更多的信息和数据时,他们想要的。我只是为了学习开发,但我认为我会快速到达100个设备/用户。

如果我使用实际上在第一次调用之后分离侦听器的 AddListenerForSingleEventValue(),是否有可能有超过100个设备使用我的应用程序与应用程序提供的数据?
是否意味着在网站上我不能同时拥有100多个听众? (如果我分开它就没事了)

解决方案


我只是为了学习开发,我假设我将快速到达100个设备/用户。


您会对此感到惊讶。大多数开发者大大高估了他们将得到的并发用户的数量。但是,如果你确实得到了他们,这将是一个很好的问题。 :)



调用 addListenerForSingleEventValue()将在第一个值后删除侦听器,但不会关闭连接。要以编程方式关闭连接,请再次调用 Firebase.goOffline(),然后再调用 Firebase.goOnline()。 >

it might be not the place, but in Firebase's site it seems that it is acceptable to ask here. In the free plan of them, where you are limited to 100 devices connected at the same time, is it when you use the AddValueEventListener () function, which make you still updated realtime.

what I want to do is just to request some data from the DB, and have users scrolling and getting more information and data when they want. I do it just to learn development, but in what I assume I will reach the 100 Devices/Users fast.

If I use the AddListenerForSingleEventValue () which actually Detach the listener after the first call, will it be possible to have more then 100 devices using my app with the data provided by the application? do they mean in the site that I cannot have more then 100 listeneres at the same time? (and if I detach it it's fine)

解决方案

I do it just to learn development, but in what I assume I will reach the 100 Devices/Users fast.

You'd be surprised about that. Most developers vastly over-estimate the number of concurrent users they will get. But if you do get them, that'd be a good problem to have. :-)

Calling addListenerForSingleEventValue() will remove the listener after the first value, but it will not close the connection. To programmatically close the connection, call Firebase.goOffline() and then Firebase.goOnline() again.

这篇关于如何限制Firebase Android上的并发连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆