Closed kellym closed 11 years ago
Nov Matake » fb_graph #9 FAILURE Looks like there's a problem with this pull request (what's this?)
Nov Matake » fb_graph #10 SUCCESS This pull request looks good (what's this?)
Nov Matake » fb_graph #11 SUCCESS This pull request looks good (what's this?)
Nov Matake » fb_graph #12 SUCCESS This pull request looks good (what's this?)
Hi,
First of all, thanks for your pull request! I've made a branch kellym-batch-mode, and merged your changes to that branch.
Could you tell me what's working and what's not? (working & not-working sample codes are very helpful)
res = FbGraph.batch(access_token: ACCESS_TOKEN) do
me = FbGraph::User.me(ACCESS_TOKEN)
me.fetch
me.friends
me.feed
end
I definitely move this forward!
Nov Matake » fb_graph #14 FAILURE Looks like there's a problem with this pull request (what's this?)
:warning: This code needs clean-up duty. It's the idea that counts.
This should help continue the development on batch requests. I did preliminary tests with
og_action!
and found it working decently well, and running a test on thefriends
method seemed to perform too.The main problem is when an action needs to be run inside a batch request, before that request is performed (i.e. fetch.namespace). That action can't run since we're already set up to queue these actions.
This adds the ability to handle the response in a block after each individual action, but it also returns all the data at the end as well. For instance:
FbGraph.batch
also returns all the responses in an array in case you need to perform another set of batch requests with them. For instance, I perform a batch of open graph actions, then use the returned ID of each to perform another batch job to get the details of those actions.It would be nice if there were a way to perform non-batch requests inside the batch block, especially requests that are performed inside FbGraph's code (like retrieving the namespace for open graph tags). Might just be a matter of creating another flag like
:batch => false
.