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?
Updated:
More info here: http://developers.facebook.com/blog/post/2011/03/17/batch-requests-in-graph-api/
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.
//$current_user=facebook id
$objs gets json array of whole result of thre queries.
And it is saving time a lot. This 3 queries individually takes total 9 seconds. With multiquery it takes 7 seconds. And with batch request it takes 3.6 seconds.