vert.x icon indicating copy to clipboard operation
vert.x copied to clipboard

Timeoutable Futures and timeoutable promises

Open knotenpunkt opened this issue 2 years ago • 1 comments

@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.

knotenpunkt avatar Jan 14 '22 00:01 knotenpunkt

I think it is interesting

vietj avatar Jan 17 '22 08:01 vietj