Hi Scott,
to me, Futures and Listeners don't need to be a contradiction.
What's more interesting to me, is how to deal with Progress.
When a Progress Monitor already exists for the client, then
using it makes a lot of sense even if the result is obtained
asynchronously:
final CBFuture<IFileStore[]> childrenF = myFileStore.list(myProgress);
childrenF.chain(new Callback() {
public void onDone(IStatus result) {
if (result.isOK()) {
handleResult(childrenF.get());
}
};
});
I'm using class "CBFuture" as an "enhanced Future" that allows
registering Callbacks. Using a Callback style of handling things,
or CBFuture.waitFor() remains up to the client. Note that I'm
using a "chain()" method to indicate that the Framework/Future could
allow chaining multiple callbacks such that one is exeucuted after
the other. Also note how the callback retrieves the result of
computation from the Future, and not from the callback itself.