@@ -157,7 +157,7 @@ internal class AwaitPromiseBuilder<T> {
157157 self . trigger = trigger
158158 }
159159
160- func timeout( _ timeoutInterval: NimbleTimeInterval , forcefullyAbortTimeout: NimbleTimeInterval ) -> Self {
160+ func timeout( _ timeoutInterval: NimbleTimeInterval , forcefullyAbortTimeout: NimbleTimeInterval , isContinuous : Bool ) -> Self {
161161 /// = Discussion =
162162 ///
163163 /// There's a lot of technical decisions here that is useful to elaborate on. This is
@@ -217,7 +217,7 @@ internal class AwaitPromiseBuilder<T> {
217217 let didNotTimeOut = timedOutSem. wait ( timeout: now) != . success
218218 let timeoutWasNotTriggered = semTimedOutOrBlocked. wait ( timeout: . now( ) ) == . success
219219 if didNotTimeOut && timeoutWasNotTriggered {
220- if self . promise. resolveResult ( . blockedRunLoop) {
220+ if self . promise. resolveResult ( isContinuous ? . timedOut : . blockedRunLoop) {
221221 #if canImport(CoreFoundation)
222222 CFRunLoopStop ( CFRunLoopGetMain ( ) )
223223 #else
@@ -385,6 +385,7 @@ internal func pollBlock(
385385 timeoutInterval: NimbleTimeInterval ,
386386 sourceLocation: SourceLocation ,
387387 fnName: String = #function,
388+ isContinuous: Bool ,
388389 expression: @escaping ( ) throws -> PollStatus ) -> PollResult < Bool > {
389390 let awaiter = NimbleEnvironment . activeInstance. awaiter
390391 let result = awaiter. poll ( pollInterval) { ( ) throws -> Bool ? in
@@ -393,7 +394,7 @@ internal func pollBlock(
393394 }
394395 return nil
395396 }
396- . timeout ( timeoutInterval, forcefullyAbortTimeout: timeoutInterval. divided)
397+ . timeout ( timeoutInterval, forcefullyAbortTimeout: timeoutInterval. divided, isContinuous : isContinuous )
397398 . wait ( fnName, sourceLocation: sourceLocation)
398399
399400 return result
0 commit comments