diff --git a/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel+Internal.swift b/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel+Internal.swift index ef2567dd..73f5f9e1 100644 --- a/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel+Internal.swift +++ b/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel+Internal.swift @@ -391,7 +391,7 @@ extension MultiProducerSingleConsumerAsyncChannel { } @inlinable - func next(isolation: isolated (any Actor)? = #isolation) async throws -> Element? { + nonisolated(nonsending) func next() async throws -> Element? { let action = self._stateMachine.withLock { $0.next() } @@ -431,7 +431,7 @@ extension MultiProducerSingleConsumerAsyncChannel { } @inlinable - func suspendNext(isolation: isolated (any Actor)? = #isolation) async throws -> Element? { + nonisolated(nonsending) func suspendNext() async throws -> Element? { try await withTaskCancellationHandler { try await withUnsafeThrowingContinuation { (continuation: UnsafeContinuation) in let action = self._stateMachine.withLock { diff --git a/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel.swift b/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel.swift index acc9a72a..a889db8a 100644 --- a/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel.swift +++ b/Sources/AsyncAlgorithms/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannel.swift @@ -201,9 +201,7 @@ public struct MultiProducerSingleConsumerAsyncChannel: /// - Parameter isolation: The callers isolation. /// - Returns: The next buffered element. @inlinable - public mutating func next( - isolation: isolated (any Actor)? = #isolation - ) async throws(Failure) -> Element? { + nonisolated(nonsending) public mutating func next() async throws(Failure) -> Element? { do { return try await self.storage.next() } catch { @@ -710,9 +708,7 @@ extension MultiProducerSingleConsumerAsyncChannel.ChannelAsyncSequence where Ele } @inlinable - mutating func next( - isolation actor: isolated (any Actor)? = #isolation - ) async throws(Failure) -> Element? { + nonisolated(nonsending) mutating func next() async throws(Failure) -> Element? { do { return try await self._backing.storage.next(isolation: actor) } catch {