如何在图api中批量请求fql查询? [英] How to do batch request of fql queries in graph api?
问题描述
我已经听说过图api中的批处理请求概念。而且我已经google了很多,但是不了解如何在图形API中使用批量请求进行fql查询。
- 任何人都可以给出解释使用批量请求的fql查询示例?
- 什么时候查询处理时间会减少?
- 有没有其他方法可以减少许多fql查询的时间?
而不是单独调用每个FQL查询,为什么不使用FQL Multiquery?
http://developers.facebook.com/docs/参考/ rest / fql.multiquery /
更新
否则,如果不想使用多查询我想你要找的是 here 。我找不到关于FQL和Batch的更多信息。
curl \
-F'access_token = ...' \
-F'batch = [{method:POST,\
relative_url:method / fql.query?query = select + name + from + user + where + uid = 4,\
}]
https://graph.facebook.com
I am having 4-5 fql queries in single function. Each of them taking 2-4 seconds to execute. Total 14-15 seconds are required to execute that whole function. User required to wait for long time. So I want to reduce that processing time. ( There is not well supported multi-threading concept in PHP.)
I have heard of batch request concept in graph api. And I have googled a lot but didn't understand how to use batch request for fql queries in graph api.
- Can anyone give explanation with example for using batch request of fql queries ?
- By what time query processing time will reduce?
- Is there any another method to reduce time of many fql queries?
Instead of calling each FQL query separately, why not use FQL Multiquery?
http://developers.facebook.com/docs/reference/rest/fql.multiquery/
UPDATE Otherwise, if you don't want do use multiquery I think what you're looking for is here. I couldn't find anything more about FQL and Batch.
curl \
-F 'access_token=…' \
-F 'batch=[{ "method": "POST", \
"relative_url": "method/fql.query?query=select+name+from+user+where+uid=4", \
}]
https://graph.facebook.com
这篇关于如何在图api中批量请求fql查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!