Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-incubator-e4-dev] Asynchronous Infrastructure (was: EFS, ECF and asynchronous)

Hi John,

I just used Futures because they are a JDK construct, so would be most universal to communicate my intent.

Hadn't realized that I could return anything from a job using a subclass of IStatus.  Cool.

Regards,

-Dave Orme

On Oct 31, 2008 9:21 AM, "John Arthorne" <John_Arthorne@xxxxxxxxxx> wrote:


There doesn't seem to be much difference between the future construct you describe and the Job API. You can attach listeners to jobs which seems to be the same as your Callback mechanism. Future.waitFor() is the same as Job.join(), and Future.get() is similar to Job.getResult(). I did actually have futures in mind when designing the jobs API, with the job's "result" being the payload returned from the asynchronous operation. I initially made this result of type Object so clients could pass back whatever return value they wanted. I then perhaps mistakenly switched the result type to IStatus, thinking that clients could return sub-types of Status containing any result object they wanted. This is why I specified almost nothing for the return value of Job#run and Job#getResult, leaving it as a mechanism for clients to communicate whatever they want back to the caller.  In reality it didn't end up being used this way, because people fell into the common coding patterns around IStatus and just returned the usual OK/ERROR results.

So, I'm wondering if there's something fundamental missing from Jobs that makes these asynchronous coding patterns difficult, and is there some incremental improvement we can make to Jobs to make it as expressive and useful as your Future construct?  If not, the org.eclipse.core.jobs bundle could still perhaps be a home for such an API, since it obviously needs a backing thread pool implementation with support for progress monitors, etc.

John


Martin Oberhuber wrote on 10/30/2008 04:47:02 PM:

> Hi Scott, Pawel and all, > > it looks like this Thread has long left the resources/EFS > aspect...


_______________________________________________
eclipse-incubator-e4-dev mailing list
eclipse-incubator-e4-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipse-incubator-e4-dev


Back to the top