4 ms·
It is a weird omission, not least because it seems that anyone that wants to use Futures ends up extending it in the same (but incompatible) way. Guava has Lis
by justinsb 13y ago
It is a weird omission, not least because it seems that anyone that wants to use Futures ends up extending it in the same (but incompatible) way. Guava has ListenableFuture, Netty has its own version, etc.
I'm not sure how this happened, but I just use Guava's ListenableFuture and am happy again.
- RyanZAG 13y agoIt was omitted because it's a complex design issue. Someone using the future would assume that if they added a callback, it would run on the same thread that they called it from. That's not possible in the general case: the thread they called it on may not have an event loop and so could not be directly notified. It's better to leave this to frameworks or libraries that have their own event loop mechanism to handle callbacks.