Java Reference
In-Depth Information
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
continue;
}
}
As you can see from the previous code snippet, we issue an asynchronous booking
[2]
and bind it with the
futureResult
instance
[1]
. We have introduced a pause
of 10 seconds to complete the booking so that later on we can check if the work has
been completed by checking the
isDone
method
[3]
of the
futureResult
object.
Here is a snapshot of our richer client application: