Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum wrote:
Hm, ok. But I guess you could reuse the callout-reference used for timeout then? Because there is no point in having both a delayed success and a delayed failure at the same time (whichever would happen further ahead in time is a no-op).
Well, I tried to argue this point to myself earlier, and I lost (I think).
Imagine this: delay(20) and timeout(30) both set on the same promise.
If the real result arrives after 15 seconds, it will be delayed for another 5 and then turned into a success. If it arrives after 25 seconds, it will be turned into a success without further delay. If it would have arrived after 35 seconds, it will be cut short as a failure at 30 seconds.
So, sadly, both call_outs make sense. The only thing I could do is make the call_out refs into an array with two fixed members. If both are not present (the common case), the array could be null.