Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to substitute Latitude's async example for a sync call
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
BlazingFrog  
View profile  
 More options Oct 28 2011, 12:55 am
From: BlazingFrog <tbert...@gmail.com>
Date: Thu, 27 Oct 2011 21:55:25 -0700 (PDT)
Local: Fri, Oct 28 2011 12:55 am
Subject: How to substitute Latitude's async example for a sync call
I'm using the Latitude example (which works great) but the calls to
Google servers are done asynchronously when my work flow would favor
synchronous calls. Is there an easy way to go synchronous?

Thanks in advance.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Phillip Oster  
View profile  
 More options Oct 28 2011, 11:58 am
From: David Phillip Oster <davidphillipos...@gmail.com>
Date: Fri, 28 Oct 2011 08:58:45 -0700
Local: Fri, Oct 28 2011 11:58 am
Subject: Re: How to substitute Latitude's async example for a sync call

I'm presuming iOS, since Macs don't move around that much. The answer is NO.
Synchronous network access gets you banned from the App Store for blocking
the user interface, often for multiple seconds, when connecting via the
cellphone network and DNS (domain name lookup) must be done.

The correct answer is: refactor your synchronous workflow so that the stuff
you do after the latitude request can go in a block which will be executed
after the data arrives.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greg Robbins  
View profile  
 More options Oct 31 2011, 8:49 pm
From: Greg Robbins <grobb...@google.com>
Date: Mon, 31 Oct 2011 17:49:54 -0700
Local: Mon, Oct 31 2011 8:49 pm
Subject: Re: How to substitute Latitude's async example for a sync call

Developers coming to Objective-C from other languages are often accustomed
to creating separate threads to wait for tasks to finish. But as David
points out, that style is discouraged in Cocoa applications. Creating
threads leads to more error-prone application code, and blocking the main
thread will hurt the device's responsiveness.

Instead, iOS and Mac apps can rely on the asynchronous calls provided by
the operating system, along with the Objective-C blocks style of callback
to keep the source code looking linear and straightforward. The library
follows that design pattern as well. Application code can be written in a
sequential style, but no new threads are needed, nor does any thread need
to be blocked by synchronous calls.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »