@@ -161,7 +161,7 @@ public struct MultiProducerSingleConsumerChannel<Element, Failure: Error>: ~Copy
161161 of elementType: Element . Type = Element . self,
162162 throwing failureType: Failure . Type = Never . self,
163163 backpressureStrategy: Source . BackpressureStrategy
164- ) -> ChannelAndStream {
164+ ) -> sending ChannelAndStream {
165165 let storage = _Storage (
166166 backpressureStrategy: backpressureStrategy. internalBackpressureStrategy
167167 )
@@ -209,7 +209,7 @@ extension MultiProducerSingleConsumerChannel {
209209 /// A struct to send values to the channel.
210210 ///
211211 /// Use this source to provide elements to the channel by calling one of the `send` methods.
212- public struct Source : ~ Copyable, Sendable {
212+ public struct Source : ~ Copyable {
213213 /// A struct representing the backpressure of the channel.
214214 public struct BackpressureStrategy : Sendable {
215215 var internalBackpressureStrategy : _InternalBackpressureStrategy
@@ -234,8 +234,8 @@ extension MultiProducerSingleConsumerChannel {
234234 /// - high: When the number of buffered elements rises above the high watermark, producers will be suspended.
235235 /// - waterLevelForElement: A closure used to compute the contribution of each buffered element to the current water level.
236236 ///
237- /// - Note, `waterLevelForElement` will be called on each element when it is written into the source and when
238- /// it is consumed from the channel, so it is recommended to provide a function that runs in constant time.
237+ /// - Important: `waterLevelForElement` will be called during a lock on each element when it is written into the source and when
238+ /// it is consumed from the channel, so it must be side-effect free and at best constant in time.
239239 public static func watermark(
240240 low: Int ,
241241 high: Int ,
@@ -446,7 +446,7 @@ extension MultiProducerSingleConsumerChannel {
446446 public mutating func send< S> (
447447 contentsOf sequence: consuming sending S
448448 ) async throws where Element == S . Element , S: Sequence , Element: Copyable {
449- let syncSend : ( sending S, inout sending Self) throws -> SendResult = { try $1. send ( contentsOf: $0) }
449+ let syncSend : ( sending S, inout Self ) throws -> SendResult = { try $1. send ( contentsOf: $0) }
450450 let sendResult = try syncSend ( sequence, & self )
451451
452452 switch consume sendResult {
@@ -481,7 +481,7 @@ extension MultiProducerSingleConsumerChannel {
481481 /// - element: The element to send to the channel.
482482 @inlinable
483483 public mutating func send( _ element: consuming sending Element) async throws {
484- let syncSend : ( consuming sending Element, inout sending Self) throws -> SendResult = { try $1. send ( $0) }
484+ let syncSend : ( consuming sending Element, inout Self ) throws -> SendResult = { try $1. send ( $0) }
485485 let sendResult = try syncSend ( element, & self )
486486
487487 switch consume sendResult {
0 commit comments