diff --git a/Package.resolved b/Package.resolved index acc33ba..84872c3 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,7 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ChimeHQ/Rearrange", "state" : { - "revision" : "3b154b59176ce40839071e7830c83410a0139d86" + "revision" : "3b154b59176ce40839071e7830c83410a0139d86", + "version" : "1.8.0" } }, { diff --git a/Sources/RangeState/RangeValidator.swift b/Sources/RangeState/RangeValidator.swift index de68c0e..23e1aa3 100644 --- a/Sources/RangeState/RangeValidator.swift +++ b/Sources/RangeState/RangeValidator.swift @@ -54,9 +54,7 @@ public final class RangeValidator { self.continuation = continuation Task { - for await versionedRange in stream { - await validateRangeAsync(versionedRange) - } + await self.beginMonitoring(stream) } } @@ -64,6 +62,12 @@ public final class RangeValidator { continuation.finish() } + private func beginMonitoring(_ stream: Sequence) async { + for await versionedRange in stream { + await self.validateRangeAsync(versionedRange) + } + } + /// Manually mark a region as invalid. public func invalidate(_ target: RangeTarget) { let invalidated = target.indexSet(with: length)