Light edit of recent doc comments. (#98)

Co-authored-by: Chris Adamson <cadamson@apple.com>
This commit is contained in:
Chris AdamsonandChris Adamson authored and GitHub committed 2022-03-22 10:05:21 -04:00
1 parent 718d647945
commit 33494899af
6 files changed
+15 -15

No files matched your search

@@ -10,19 +10,19 @@
//===----------------------------------------------------------------------===//
extension AsyncSequence {
/// Create a rate limited `AsyncSequence` by emitting values at most every specified interval.
/// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval.
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
public func throttle<C: Clock, Reduced>(for interval: C.Instant.Duration, clock: C, reducing: @Sendable @escaping (Reduced?, Element) async -> Reduced) -> AsyncThrottleSequence<Self, C, Reduced> {
AsyncThrottleSequence(self, interval: interval, clock: clock, reducing: reducing)
}
/// Create a rate limited `AsyncSequence` by emitting values at most every specified interval.
/// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval.
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
public func throttle<Reduced>(for interval: Duration, reducing: @Sendable @escaping (Reduced?, Element) async -> Reduced) -> AsyncThrottleSequence<Self, ContinuousClock, Reduced> {
throttle(for: interval, clock: .continuous, reducing: reducing)
}
/// Create a rate limited `AsyncSequence` by emitting values at most every specified interval.
/// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval.
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
public func throttle<C: Clock>(for interval: C.Instant.Duration, clock: C, latest: Bool = true) -> AsyncThrottleSequence<Self, C, Element> {
throttle(for: interval, clock: clock) { previous, element in
@@ -34,14 +34,14 @@ extension AsyncSequence {
}
}
/// Create a rate limited `AsyncSequence` by emitting values at most every specified interval.
/// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval.
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
public func throttle(for interval: Duration, latest: Bool = true) -> AsyncThrottleSequence<Self, ContinuousClock, Element> {
throttle(for: interval, clock: .continuous, latest: latest)
}
}
/// A rate limited `AsyncSequence` by emitting values at most every specified interval.
/// A rate-limited `AsyncSequence` by emitting values at most every specified interval.
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
public struct AsyncThrottleSequence<Base: AsyncSequence, C: Clock, Reduced> {
let base: Base