[concurrency-interest] Accessing original callable object from a Future?

Martin Buchholz martinrb at google.com
Mon Jun 23 21:45:35 EDT 2014


There is nothing in java.util.concurrent to make this easier.  Future in
general is not associated with any task, so there is no API there to help
you.  FutureTask *is* associated with a task, but it tries hard to forget
about it once it reaches the "done" state, to make the memory reclaimable.

On Mon, Jun 23, 2014 at 4:41 PM, Kevin Regan <regank at google.com> wrote:

> Sometimes, I find the need to be able to access the original Callable
> object from a Future.  It seems like this requires the a keep a map from
> Future to the original Callable value (and assuming that
> ExecutionCompletionService returns the same Future in take() as in
> submit()).
> Has there been any thought into possibly making this task easier?
>  Possibly some way of connecting some identifying information with the
> Future?
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20140623/f6fe3051/attachment-0001.html>

More information about the Concurrency-interest mailing list