-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch support #13
Comments
looks ok to me, however I'm thinking how we could support both, so that we don't always need to request a batch if not needed.. Do you have an idea? |
I would prefer to not have two separate versions of each function. One cool feature of other libraries I've worked with is that you can open a batch, call functions that make requests, and have them automatically batched up without knowing they're participating in the batch. Not sure how to make that happen in Elixir. |
Could you show me such a library so I'd get a clearer view how they're doing that? |
The specific example I know best is koala in ruby. Here's a simple snippet: @graph.batch do |batch_api|
# Assuming you have database fields "about_me" and "photos"
batch_api.get_object('me') {|me| self.about_me = me }
batch_api.get_connections('me', 'photos') {|photos| self.photos = photos }
end In this case the two calls to the batch api get put together, the responses to the batch are taken apart and the correct one is fed to each block and the block called before the In Elixir's semantics, we'd probably want to do that differently, and I don't know how. But doing large-scale work with Facebook without batching is going to be painful. |
Hey, |
ping @asolove |
I'm no longer working on the project this was intended for. Batch support is still a great idea for serious users of the FB API, but I don't have much insight into how to implement it, so I will just close this. |
I was looking into this the other day, and if I have some free time I might dig into batch support. Is it possible to re-open this? I think @tfinnell is working on implementing |
I'll likely have a PR put together in the next few days as I get time to work more on it. This would be interesting to implement and I'm wondering if it could be done without having to swap responses for requests, but rather intercept and rewrite the requests (exvcr is doing a similar interception I believe). |
I'm sure we can do some pattern matching magic to accomplish this. I'll revisit some time next week. Going to spend a bit of time on one of my projects. |
I would like to add support for batch requests. I think this will necessitate some design changes. In particular, I think it means many of the API methods should return a request instead of a response, and then adding a new function that sends one or a batch of requests together and returns a response.
Here's how it might(?) look:
The text was updated successfully, but these errors were encountered: