Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Synchronous API #2

Closed
GoogleCodeExporter opened this issue Apr 21, 2015 · 5 comments
Closed

Synchronous API #2

GoogleCodeExporter opened this issue Apr 21, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

The APIs are designed to work asynchroneously using delegates.

This can be an issue in some cases. (for GUI-less daemons especially)

There needs to be an API for this. (which works better than waitForTicket: 
which is polling events 
every 1/1000s)



Original issue reported on code.google.com by brun...@gmail.com on 13 Jan 2008 at 4:21

@GoogleCodeExporter
Copy link
Author

Any tool can use NSRunLoop's -currentRunLoop and -runUntilDate to make the async
callbacks work. No user interface is necessary.

All of the GDataObject data classes can be used independently of the 
GDataService
classes as well.

waitForTicket: doesn't poll for events; it polls for completion of the ticket. 
Events happen asynchronously.

Original comment by gregrobbins on 13 Jan 2008 at 5:22

@GoogleCodeExporter
Copy link
Author

So, please don't deprecate waitForTicket: in future releases, as it is useful.

I however think that it would be better if the GData API could provide 
synchronous methods (using NSURLConnection's convenience class method, 
sendSynchronousRequest:returningResponse:error:, to load a 
URL request synchronously, for example)

This would also make GData/ObjC more inline with the API provided by other 
languages (I haven't checked all, 
but Python and Java are in this case it seems).
I think it's much easier (and cleaner) to type something like    
CalendarFeed resultFeed = service.getFeed(feedUrl, CalendarFeed.class);
or
feed = self.cal_client.GetAllCalendarsFeed()
than what is currently required by GData/ObjC what async download isn't 
needed/wanted.



Original comment by brun...@gmail.com on 13 Jan 2008 at 7:08

@GoogleCodeExporter
Copy link
Author

I wrote a synchronous wrapper using NSRunLoop.  Some convenience methods aren't 
necessary, but they would be nice.

Original comment by lem...@gmail.com on 31 Jan 2010 at 2:03

@GoogleCodeExporter
Copy link
Author

Hi Lem, Could you provide your code for the sync wrapper?

Original comment by smith....@gmail.com on 8 Jul 2011 at 3:43

@GoogleCodeExporter
Copy link
Author

The library does include waitForTicket: and waitForCompletionWithTimeout: 
methods for use by unit tests and UI-less tools, so there's no need for a 
wrapper.

Synchronous http fetches are sufficient reason for apps to be rejected from 
Apple's app stores. 

Original comment by grobb...@google.com on 8 Jul 2011 at 8:33

  • Changed state: WontFix

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant