From 822cfb8331d64a1baf4fe073498a580a84afcd7e Mon Sep 17 00:00:00 2001 From: Aniket <42694864+aniketatgithub@users.noreply.github.com> Date: Fri, 2 Oct 2026 05:04:26 -0700 Subject: [PATCH] Fix MultiProducerSingleConsumerAsyncChannel doc examples to use takeChannel() (#460) The stored channel property of ChannelAndStream is intentionally internal, so the documented consume channelAndSource.channel snippet fails to compile for clients. The supported API is takeChannel(); use it in both doc examples. Signed-off-by: Aniket --- .../MultiProducerSingleConsumerAsyncChannel.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel.swift b/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel.swift index 7c9a3b3..519c88f 100644 --- a/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel.swift +++ b/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel.swift @@ -37,13 +37,13 @@ public struct MultiProducerSingleConsumerAsyncChannelAlreadyFinishedError: Error /// Afterwards, you can pass the source to the producer and the channel to the consumer. /// /// ``` -/// let channelAndSource = MultiProducerSingleConsumerAsyncChannel.makeChannel( +/// var channelAndSource = MultiProducerSingleConsumerAsyncChannel.makeChannel( /// of: Int.self, /// backpressureStrategy: .watermark(low: 2, high: 4) /// ) /// /// // The channel and source can be extracted from the returned type -/// let channel = consume channelAndSource.channel +/// let channel = channelAndSource.takeChannel() /// let source = consume channelAndSource.source /// ``` /// @@ -127,11 +127,11 @@ public struct MultiProducerSingleConsumerAsyncChannel: /// components from it. /// /// ```swift - /// let channelAndSource = MultiProducerSingleConsumerAsyncChannel.makeChannel( + /// var channelAndSource = MultiProducerSingleConsumerAsyncChannel.makeChannel( /// of: Int.self, /// backpressureStrategy: .watermark(low: 5, high: 10) /// ) - /// var channel = consume channelAndSource.channel + /// var channel = channelAndSource.takeChannel() /// var source = consume channelAndSource.source /// ``` @frozen