I found the following code example online:
long waitTimeMilliSecs = ONE_SECOND;
// After the create() call completes, we must poll the results of the checkStatus()
// call until it indicates that the create operation has completed.
do {
printAsyncResultStatus(asyncResults);
waitTimeMilliSecs *= 2;
Thread.sleep(waitTimeMilliSecs);
asyncResults = metadataConnection.checkStatus(new String[]{asyncResults[0].getId()});
} while (!asyncResults[0].isDone());
1, 3, 7 and 15 Seconds is a long time to wait for a response... I'd like to write my application to respond faster than that especially in the event of a 3.1 second response! The question is, what is behind the isDone() method of AsyncResults? Does it just check a local boolean that some other thread will eventually set to true, or does it fire query out to salesforce to get a status report?
The documentation doesn't seem to say anything one way or another, but the long wait times in the example make it look like they think it is expensive.