Comments (10)
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?
from facebook.ex.
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.
from facebook.ex.
Could you show me such a library so I'd get a clearer view how they're doing that?
from facebook.ex.
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 batch
call finishes.
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.
from facebook.ex.
Hey,
sorry for not coming back to you earlier. Sounds like a cool API but I'm unsure as well how to do that (without some macro stuff which makes it a bit harder to follow the code).
So I propose for now to go for the first proposal you had. Do you agree?
from facebook.ex.
ping @asolove
from facebook.ex.
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.
from facebook.ex.
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 HTTPoison
, so I wanted to check in and see if that's happening in the near-future. If so, I might hold off for a bit.
from facebook.ex.
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).
from facebook.ex.
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.
from facebook.ex.
Related Issues (19)
- Facebook Page info HOT 1
- Error when request to Graph API HOT 8
- module :hmac is not available HOT 4
- Document Getting Started HOT 6
- Ability to upload images/videos HOT 4
- Where do I set the App ID ? HOT 3
- Unable to read env key HOT 1
- Method names should be in snake case HOT 4
- Inconsistent Returns HOT 11
- Configuration sample HOT 2
- "Invalid verification code format." HOT 7
- Ability to add custom params and few other features HOT 1
- Versioned graph url doesn't work with exchanging long lived access token HOT 4
- Can't request me object: Hackney config HOT 3
- Looking for a new maintainer HOT 14
- PROPOSAL - Add extendable usage HOT 1
- HTTPPosion version bump HOT 2
- New version HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook.ex.