From a6ad9b82e910bf129511f937dd677401405e7d80 Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Fri, 18 Feb 2022 16:44:26 -0800 Subject: [PATCH] Conditional conformance for Sendable for throttle types (#52) --- Sources/AsyncAlgorithms/AsyncThrottleSequence.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/AsyncAlgorithms/AsyncThrottleSequence.swift b/Sources/AsyncAlgorithms/AsyncThrottleSequence.swift index cec6ca8..15d8757 100644 --- a/Sources/AsyncAlgorithms/AsyncThrottleSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncThrottleSequence.swift @@ -51,8 +51,6 @@ public struct AsyncThrottleSequence { } } -extension AsyncThrottleSequence: Sendable where Base: Sendable, Element: Sendable { } - extension AsyncThrottleSequence: AsyncSequence { public typealias Element = Reduced @@ -90,3 +88,6 @@ extension AsyncThrottleSequence: AsyncSequence { Iterator(base.makeAsyncIterator(), interval: interval, clock: clock, reducing: reducing) } } + +extension AsyncThrottleSequence: Sendable where Base: Sendable, Element: Sendable { } +extension AsyncThrottleSequence.Iterator: Sendable where Base.AsyncIterator: Sendable { }