Timeout handlers and Exceptions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Timeout handlers and Exceptions

tc416
Hello,

  I am trying to learn Ratpack for a while now, and i have written few apps while learning, one of the questions i have is How do i add a timeout for each event or thread that it is waiting for, for example how do i add a timeout to a promise , so that if i did not get the response within that time i can throw the exception.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Timeout handlers and Exceptions

Luke Daley
Administrator
Hi,

I thought we had an issue for this, but we didn’t. I’ve just created one. 


At the moment you’d have to implement this yourself in the promise fulfiller by using the execution controller executer to set something to fire on timeout that fulfils the promise, and then dealing with the late value somehow.