From b8cd6eaa75c79cf502ec35cfe283ee1dea25a041 Mon Sep 17 00:00:00 2001 From: qwerty3345 Date: Mon, 26 Aug 2024 14:48:05 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[DOCS]=20fix=20typo:=20precicely=20?= =?UTF-8?q?=E2=86=92=20precisely?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Evolution/0006-combineLatest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Evolution/0006-combineLatest.md b/Evolution/0006-combineLatest.md index 584b068a..bcdf6a84 100644 --- a/Evolution/0006-combineLatest.md +++ b/Evolution/0006-combineLatest.md @@ -13,7 +13,7 @@ ## Introduction -Similar to the `zip` algorithm there is a need to combine the latest values from multiple input asynchronous sequences. Since `AsyncSequence` augments the concept of sequence with the characteristic of time it means that the composition of elements may not just be pairwise emissions but instead be temporal composition. This means that it is useful to emit a new tuple _when_ a value is produced. The `combineLatest` algorithm provides precicely that. +Similar to the `zip` algorithm there is a need to combine the latest values from multiple input asynchronous sequences. Since `AsyncSequence` augments the concept of sequence with the characteristic of time it means that the composition of elements may not just be pairwise emissions but instead be temporal composition. This means that it is useful to emit a new tuple _when_ a value is produced. The `combineLatest` algorithm provides precisely that. ## Detailed Design From 4f30a02b3b55efaed80ae4ec16f60807f22a7854 Mon Sep 17 00:00:00 2001 From: qwerty3345 Date: Mon, 26 Aug 2024 14:49:04 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[DOCS]=20fix=20typo:=20ever=20=E2=86=92=20e?= =?UTF-8?q?very?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Evolution/0011-interspersed.md | 6 +++--- .../Interspersed/AsyncInterspersedSequence.swift | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Evolution/0011-interspersed.md b/Evolution/0011-interspersed.md index cfc99737..27e5dbc1 100644 --- a/Evolution/0011-interspersed.md +++ b/Evolution/0011-interspersed.md @@ -178,7 +178,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .element(separator) self.every = every @@ -186,7 +186,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .syncClosure(separator) self.every = every @@ -194,7 +194,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () async -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .asyncClosure(separator) self.every = every diff --git a/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift b/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift index 9932e77e..78ef20d3 100644 --- a/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift +++ b/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift @@ -157,7 +157,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .element(separator) self.every = every @@ -165,7 +165,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .syncClosure(separator) self.every = every @@ -173,7 +173,7 @@ public struct AsyncInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () async -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .asyncClosure(separator) self.every = every @@ -310,7 +310,7 @@ public struct AsyncThrowingInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () throws -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .syncClosure(separator) self.every = every @@ -318,7 +318,7 @@ public struct AsyncThrowingInterspersedSequence { @usableFromInline internal init(_ base: Base, every: Int, separator: @Sendable @escaping () async throws -> Element) { - precondition(every > 0, "Separators can only be interspersed ever 1+ elements") + precondition(every > 0, "Separators can only be interspersed every 1+ elements") self.base = base self.separator = .asyncClosure(separator) self.every = every From c1d59e0c6eda5f44a6a394e4f2615d94512afc34 Mon Sep 17 00:00:00 2001 From: qwerty3345 Date: Mon, 26 Aug 2024 14:52:37 +0900 Subject: [PATCH 3/3] [DOCS] fix typo: AsyncBufferSequence, relative --- Evolution/0010-buffer.md | 4 ++-- Evolution/NNNN-rate-limits.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Evolution/0010-buffer.md b/Evolution/0010-buffer.md index da56def7..e77f6d81 100644 --- a/Evolution/0010-buffer.md +++ b/Evolution/0010-buffer.md @@ -28,7 +28,7 @@ By applying the buffer operator to the previous example, the file can be read as ## Proposed Solution -We propose to extend `AsyncSequence` with a `buffer()` operator. This operator will return an `AsyncBuffereSequence` that wraps the source `AsyncSequence` and handle the buffering mechanism. +We propose to extend `AsyncSequence` with a `buffer()` operator. This operator will return an `AsyncBufferSequence` that wraps the source `AsyncSequence` and handle the buffering mechanism. This operator will accept an `AsyncBufferSequencePolicy`. The policy will dictate the behaviour in case of a buffer overflow. @@ -43,7 +43,7 @@ public struct AsyncBufferSequencePolicy: Sendable { } ``` -And the public API of `AsyncBuffereSequence` will be: +And the public API of `AsyncBufferSequence` will be: ```swift extension AsyncSequence where Self: Sendable { diff --git a/Evolution/NNNN-rate-limits.md b/Evolution/NNNN-rate-limits.md index 94bf6e89..e78c60d1 100644 --- a/Evolution/NNNN-rate-limits.md +++ b/Evolution/NNNN-rate-limits.md @@ -18,7 +18,7 @@ ## Introduction -When events can potentially happen faster than the desired consumption rate, there are multiple ways to handle the situation. One approach is to only emit values after a given period of time of inactivity, or "quiescence", has elapsed. This algorithm is commonly referred to as debouncing. A very close reelativee is an apporach to emit values after a given period has elapsed. These emitted values can be reduced from the values encountered during the waiting period. This algorithm is commonly referred to as throttling. +When events can potentially happen faster than the desired consumption rate, there are multiple ways to handle the situation. One approach is to only emit values after a given period of time of inactivity, or "quiescence", has elapsed. This algorithm is commonly referred to as debouncing. A very close relative is an approach to emit values after a given period has elapsed. These emitted values can be reduced from the values encountered during the waiting period. This algorithm is commonly referred to as throttling. ## Proposed Solution