vert.x
vert.x copied to clipboard
Timeoutable Futures and timeoutable promises
@vietj i know its a old idea, but maybe you think its a good idea now?^^
What do you think about having timeoutable Futures?
myFuture.onComplete();
could be then myFuture.toTimeoutFuture(someTime).onComplete();
If the timeout is over the future is finished with an exception-cause
On the other side we could have also timeoutable promises.
Promise.promise() //its a normal promise
Promise.promise(someTime); //its a timeoutable promise
in that case all registered listeners and listeneres in the future get an timeout exception-cause, if it is not finished in someTime
So you don't need to wrap it into bigger classes with also other functionality you not really want to have -> Circuit-breakers and so on.
I think it is interesting