Post

Replies

Boosts

Views

Activity

Reply to AsyncStream stops dispatching
This was the response I received from the Swift forum https://forums.swift.org/t/asyncstream-stops-yielding-values/75514 mbrandonw Brandon Williams 4m Hi @Biclops, if I'm reading your code correctly it seems that you are subscribing to an AsyncStream twice: once in setupAsyncWrites and once in waitForHandshakedone. Unfortunately AsyncStream does not support multiple subscribers. You can look into using AsyncChannel from the swift-async-algorithms package, but it's also subtly different. In particular, the channel.send method will suspend until someone consumes the value being emitted.
Oct ’24