Describe the bug
When using .multicast I got unexpected error: attempt to await next() on more than one task. It is my - maybe incorrect? - understanding that I could use several tasks consuming an Async Multicasted sequence?
To Reproduce
I have these variables:
actorConnection{privateletasyncStream:AsyncThrowingStream<MySendableStruct,Swift.Error>privateletasyncContinuation:AsyncThrowingStream<MySendableStruct,Swift.Error>.ContinuationprivateletmulticastSubject=AsyncThrowingPassthroughSubject<MySendableStruct,Swift.Error>()...
// using this static func: https://github.com/pointfreeco/swift-composable-architecture/blob/53ddc5904c065190d05c035ca0e4589cb6d45d61/Sources/ComposableArchitecture/Effects/ConcurrencySupport.swift#L222-L228
(asyncStream, asyncContinuation)=AsyncThrowingStream.streamWithContinuation()...func autoconnectingMulticastedAsync()->AsyncMulticastSequence<AsyncThrowingStream<MySendableStruct,Swift.Error>,AsyncThrowingPassthroughSubject<MySendableStruct,Swift.Error>>{
asyncStream
.multicast(multicastSubject).autoconnect()}}and callsite
...func connect()asyncthrows{
connectTask?.cancel()
connectTask =Task{fortryawaitvalueinautoconnectingMulticastedAsync(){guard !Task.isCancelled else{return}
// do stuff with `value` that in some case might trigger a new nested `Task`
...}}..Provide code snippets, or links to gist or repos if possible.
Expected behavior
I would expect to be able to await values in multiple tasks from a multicasted autoconnected Async Seqyuence.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
Mac Studio (M1), running macOS Ventura: 13.0.1 (22A400)
Xcode Version 14.1 (14B47b)
AsyncExtension version 0.5.1
Additional context
Add any other context about the problem here.
Describe the bug
When using
.multicastI got unexpected error:attempt to await next() on more than one task. It is my - maybe incorrect? - understanding that I could use several tasks consuming an Async Multicasted sequence?To Reproduce
I have these variables:
and callsite
Provide code snippets, or links to gist or repos if possible.
Expected behavior
I would expect to be able to await values in multiple tasks from a multicasted autoconnected Async Seqyuence.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
Mac Studio (M1), running macOS Ventura: 13.0.1 (22A400)
Xcode Version 14.1 (14B47b)
AsyncExtension version 0.5.1
Additional context
Add any other context about the problem here.