By default, Swift's `AsyncStream` does not allow m...
# touchlab-tools
c
By default, Swift's
AsyncStream
does not allow multiple consumers. But SKIE seems to have solved this: a `StateFlow`/`SharedFlow` can have multiple consumers:
Copy code
for await foo in someFlow { thing(foo) }
for await bar in someFlow { whatevs(bar) }
Where can I poke around to see what variant of `AsyncStream`/`AsyncPublisher` SKIE uses under the hood?
f
One option is to look at the generated Swift code which can be found in
build/skie/……/swift/generated
There you can find the directory Skie inside which is the Flow runtime (and other things) However, it will likely not give you much insight into how to achieve something like this with AsyncStreams because we have custom implementation that “just” wraps the calls and passes them to the Kotlin Flows. Therefore, this logic is handled by the Kotlin Coroutines.
👍🏽 1