Facebook API - Using multiple requests in Rails Model
I have written an app that I am not happy with. Essentially it queries the Facebook API in a few ways:
- Gets a list of all posts
- Ret开发者_如何转开发rieves each post
- Retrieves each posts comments
I can get a list of all posts in 1 API request, but I've nested each subsequent API request in a loop. I'd like to do this all at once, and is there any reading on sending all the requests at once, and then handling the API requests as they come in?
I'm looking for reading, GEMS, suggestions at strategies.
Thanks!
Take a look at the answers here: What is the preferred way of performing non blocking I/O in Ruby?
Good options seems to be:
- Typhoeus
- EventMachine + em-http-request
精彩评论