Update Promise >> #waitTimeoutMSecs: to stop waiting if the promise is rejected, as well as if it's accepted.
=============== Diff against Kernel-tonyg.1150 ===============
Item was changed:
----- Method: Promise>>waitTimeoutMSecs: (in category 'waiting') -----
+ "Wait for at most the given number of milliseconds for this promise to settle.
+ Answer true if it is resolved, false otherwise. False can therefore mean EITHER 'timeout' OR 'rejected'."
- "Wait for at most the given number of milliseconds for this promise to resolve. Answer true if it is resolved, false otherwise."
| sema delay |
sema := Semaphore new.
self whenResolved: [sema signal].
+ self whenRejected: [sema signal].
delay := Delay timeoutSemaphore: sema afterMSecs: msecs.
[sema wait] ensure: [delay unschedule].
^ self isResolved.!