0
我有一个云编写的代码Parse.com会考虑多少个API请求?
Parse.Cloud.define("getApartmentVendorProduct", function(request, response) {
var isApartmentCallComplete = false;
var isVendorCallComplete = false;
var isProductCallComplete = false;
var result = {};
var apartmentQuery = new Parse.Query("Apartment");
apartmentQuery.find({
success: function(results) {
isApartmentCallComplete = true;
results.apartments = results;
}
});
var vendorQuery = new Parse.Query("Vendor");
vendorQuery.find({
success: function(results) {
isVendorCallComplete = true;
results.vendors = results;
}
});
var productQuery = new Parse.Query("Product");
productQuery.find({
success: function(results) {
isProductCallComplete = true;
results.products = results;
}
});
setInterval(function() {
if (isApartmentCallComplete && isVendorCallComplete && isProductCallComplete) {
response.success(results);
}
}, 50);
});
PS:我很清楚地知道,在setInterval的解析不会工作。这个代码仅仅是理解。
在这个云功能,我正在做3查询操作。
从我的Android应用我打电话这个云代码。
这里是我的问题。 这个考虑了多少个API请求?通过云代码和由Android制成1项API请求作出
1)3 API请求 - 共计4
2)由Android制成仅有1 API请求。 - 总计1
应该选择1.你可以检查'阿比Requests'这在应用程序的分析仪表板。 – eth3lbert 2014-12-15 00:17:06
感谢和是的选项是1我会发布我试过的代码 – 2014-12-15 05:33:46