sygma6 wrote:Either you know that the operation has completed, or you don't. If you know that it has completed, then you can just call get(), and it won't have any reason to block. If you don't know that it has completed, how will you decide when to get the result? Or, alternatively, what are you planning to do if, when you go to get the result, it's not ready yet?
Yes but at some point I need to get the result of the Future. So I have to call Future.get() somewhere.
sygma6 wrote:But, again, how are you planning to know when it's done?
Well, the idea is that I can have anywhere from 0->n Futures waiting to be processed at any time. So I call take() when a Future appears, and get() when it's done.
I can't know when each one is going to be ready for processing. I don't care what order they are processed in. I just want them processed as they become available.So then you need to call take() or get() or whatever blocking call is appropriate. And if you don't want to block because there's other work you could be doing if nothing is available, then you should put that take() or get() call into a separate thread.