On Aug 6, 2008, at 10:14 AM, Jarek Gawor wrote:
On Wed, Aug 6, 2008 at 1:00 PM, Dain Sundstrom <[EMAIL PROTECTED]> wrote:
On Aug 5, 2008, at 1:25 PM, David Jencks wrote:
Is there something similar in the ee concurrency spec?
Never heard of that spec. Do you have any details?
Here's some info on the spec:
http://gee.cs.oswego.edu/dl/concurrencyee-interest/index.html
http://www.jcp.org/en/jsr/detail?id=236
and in Geronimo (trunk) we have a basic implementation of the draft
spec.
Interesting. It would be nice if there were something like this for
the client side. One big I issue I see with EJB async methods is
there is no way to be notified when the result of an async method is
ready. This API is very close to being what we would need.
Specifically this method on ManagedExecutorService:
submit(Callable<T> task, ManagedTaskListener taskListener)
which adds a task to run with a listener for it's completion. For
async result support we would need something like this:
waitForResult(Future<?> future, ManagedTaskListener
taskListener)
of maybe
submit(new WaitForCallable(myFuture), taskListener)
If the future instance implemented a special "notifiable" interface,
the Executor service would simply add the listener to the future. If
it didn't implement that interface, it would use a thread to block (or
periodically poll) for the result.
Something like this would allow users to write efficient and spec
compliant async clients.
David (Jencks), are you working on this spec? Any chances on getting
something like this in?
-dain