Kotlin / kotlinx.coroutines

Library support for Kotlin coroutines
Apache License 2.0
12.77k stars 1.82k forks source link

MultiplexFlow #4101

Closed odedniv closed 1 month ago

odedniv commented 1 month ago

This is useful when the source allows only a single subscription, but the data is needed by multiple users.

It's extremely hard to get this right, so I feel having a kotlinx implementation would be very useful.

odedniv commented 1 month ago

Half way through the tests I realized I should probably get some feedback on the idea, so once I get that feedback I can continue implementing the missing test cases.

qwwdfsad commented 1 month ago

Please start with an issue to explain the problem being solved and gather some feedback.

Then, we'll be able to see how it fits in kotlinx.coroutines, what is the others' feedback and will proceed with PR (see also: CONTRIBUTING.md).

Closing as "not enough use-cases", we'll reopen once we decide it should be added

odedniv commented 1 month ago

Created #4103. For future reference please ignore the last state of this PR in favor of the latest state of https://github.com/Kotlin/kotlinx.coroutines/compare/master...odedniv:kotlinx.coroutines:multiplex.