You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example works perfectly for simple sequential flow generation.
However, issues arise when concurrency is introduced into the flow generation process. For example:
As can be seen from the example above, the create method does not handle concurrency, leading to a situation where the resulting flow size can be less than taskCount. This behavior is not documented, which can confuse users who might expect concurrent generation to work seamlessly.
To address this issue, it would be beneficial to differentiate between methods designed for simple non-concurrent workflows and those that handle concurrency by default. Specifically:
Introduce a generate method. This method would be intended for simple, non-concurrent workflows. It would clearly indicate to users that it is not designed for concurrent flow generation.
Enhance the create method. Modify the create method to handle concurrency properly by default. This would involve ensuring that concurrent tasks are managed and their emissions are correctly handled to prevent missing items.
By introducing the generate method and enhancing the create method to handle concurrency, users would have the opportunity to select an appropriate approach for handling their tasks.
This would provide functionality similar to the distinction between flow and channelFlow in Kotlin.
The text was updated successfully, but these errors were encountered:
The FiberInterop library allows creating an RxJava
Flowable
stream easily, as demonstrated in the following example:This example works perfectly for simple sequential flow generation.
However, issues arise when concurrency is introduced into the flow generation process. For example:
As can be seen from the example above, the
create
method does not handle concurrency, leading to a situation where the resulting flow size can be less thantaskCount
. This behavior is not documented, which can confuse users who might expect concurrent generation to work seamlessly.To address this issue, it would be beneficial to differentiate between methods designed for simple non-concurrent workflows and those that handle concurrency by default. Specifically:
generate
method. This method would be intended for simple, non-concurrent workflows. It would clearly indicate to users that it is not designed for concurrent flow generation.create
method. Modify thecreate
method to handle concurrency properly by default. This would involve ensuring that concurrent tasks are managed and their emissions are correctly handled to prevent missing items.By introducing the
generate
method and enhancing thecreate
method to handle concurrency, users would have the opportunity to select an appropriate approach for handling their tasks.This would provide functionality similar to the distinction between flow and channelFlow in Kotlin.
The text was updated successfully, but these errors were encountered: