ryanscott / bamboo

a lightweight, simple objective-c library implementation of facebook's graph api, for the iPhone.
Other
39 stars 2 forks source link

Asynchronous network support #1

Open ryanscott opened 14 years ago

ryanscott commented 14 years ago

Currently the GraphAPI only supports synchronous networks calls, via NSURLConnection sendSynchronousRequest. This is how all the other server-side libraries work, but I think most iPhone network code is more typically asynchronous. I want bamboo to support asynchronous requests.

What is the demand for asynchronous support? And, what sort of API should we build into the library? I am thinking over this issue right now, trying to design a simple interface, while still surfacing as much detail as necessary.

If you have a use case, an actual need, or any other input, please let me know.

ryanscott commented 14 years ago

I like how Matt Gemmell handles this in his MGTwitterEngine (http://github.com/mattgemmell/MGTwitterEngine). I'm thinking something like that, though maybe using NSNotifciationCenter instead of delegates.

yosit commented 14 years ago

+1 MGTwitterEngine is a great example of how networking api's should work, though it has it's over head of understanding what's going on there.

petem commented 13 years ago

But isn't it funny how when we have an asynchronous API, we go to lots of trouble to serialize access using threads, callbacks, state machine or whatever? I want to create an album and load photos into it. I need the aid of the created album first don't I? For my use I think I'd prefer a synchronous approach if handed to me.

yosit commented 13 years ago

the main problem with synchronous calls is that it blocks the UI - you don't want your app to freeze every time you do network calls.