From 6b59cfb8d075c011f9d74e0a300b84f726a45d75 Mon Sep 17 00:00:00 2001 From: Kevin Tan Date: Tue, 3 May 2022 21:17:53 -0700 Subject: [PATCH] Minor documentation improvements (#153) --- Sources/AsyncAlgorithms/AsyncChannel.swift | 8 ++++---- Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/AsyncAlgorithms/AsyncChannel.swift b/Sources/AsyncAlgorithms/AsyncChannel.swift index f6d132f..a9922a9 100644 --- a/Sources/AsyncAlgorithms/AsyncChannel.swift +++ b/Sources/AsyncAlgorithms/AsyncChannel.swift @@ -13,10 +13,10 @@ /// /// The `AsyncChannel` class is intended to be used as a communication type between tasks, /// particularly when one task produces values and another task consumes those values. The back -/// pressure applied by `send(_:)` and `finish()` via the suspension/resume ensure that -/// the production of values does not exceed the consumption of values from iteration. Each of these -/// methods suspends after enqueuing the event and is resumed when the next call to `next()` -/// on the `Iterator` is made. +/// pressure applied by `send(_:)` and `finish()` via the suspension/resume ensures that +/// the production of values does not exceed the consumption of values from iteration. Each of these +/// methods suspends after enqueuing the event and is resumed when the next call to `next()` +/// on the `Iterator` is made. public final class AsyncChannel: AsyncSequence, Sendable { /// The iterator for a `AsyncChannel` instance. public struct Iterator: AsyncIteratorProtocol, Sendable { diff --git a/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift b/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift index 7a9e9a3..9815462 100644 --- a/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift @@ -37,6 +37,7 @@ extension AsyncSequence { /// error, `AsyncChunkedByGroupSequence` will rethrow that error immediately and discard /// any current group. /// +/// let numbers = [10, 20, 30, 10, 40, 40, 10, 20].async /// let chunks = numbers.chunked { $0 <= $1 } /// for await numberChunk in chunks { /// print(numberChunk)