firestore sdk是否使用连接的套接字发出其请求或单个http请求? [英] Does the firestore sdk use a connected socket to make its requests or individual http requests?

查看:29
本文介绍了firestore sdk是否使用连接的套接字发出其请求或单个http请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用react native firebase sdk,想知道如何实现底层网络调用.在使Firestore获取查询时,SDK是在初始化套接字时才保持套接字打开并通过打开的套接字发出请求,还是向端点发出单个http请求?

I'm using the react native firebase sdk and am wondering about how the underlying network calls are implemented. When making firestore get queries, is the sdk just keeping a socket open when it's initialized and make requests over the open socket, or does it make individual http requests to an endpoint?

具体来说,我正在寻找一种有效的方式来获取一批文档(给定了一组配置文件ID的配置文件缩略图属性),我看到了一个答案,说Firebase调用已进行管道传输,因此并行调用gets是有效的.但是,我不确定这是否也适用于Firestore.

Specifically I'm looking for an efficient way to get a batch of documents (profile thumbnail properties given a batch of profile ids), and I saw an answer that said that firebase calls are pipelined so calling the gets in parallel is efficient. However, I'm not sure if that applies to firestore as well.

推荐答案

Firestore SDK使用 gRPC 与服务器.这是许多其他Google其他Cloud产品在后台使用的同一层.它与Firebase实时数据库所依赖的Web套接字通信层完全不同.

The Firestore SDK uses gRPC to communicate with the server. This is the same layer that many of Google's other Cloud products use under the hood. It is quite different from the Web Sockets communication layer that the Firebase Realtime Database relied on.

这篇关于firestore sdk是否使用连接的套接字发出其请求或单个http请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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