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
Coming from RxJS it was really convenient having the concatMap operator to have a pipeline of dynamic observables that wait for the previous to complete. I noticed that RxPY does not have an obvious equivalent (closest is flat_map but I can't have interleaving).
From what relevant docs/issues I could find, it seems that the following would achieve the same functionality but feels dirty. The of(...)'s are a stand-in for some code that would dynamically generate a new observable depending on the result from the previous.
of(1).pipe(
map(lambda x: of(x + 1)), # Dynamically generate observable
merge(max_concurrent=1), # Merge and wait to finish
map(lambda x: of(x + 1)), # Dynamically generate observable
merge(max_concurrent=1) # Merge and wait to finish
)
Is there a better way to achieve this currently (or in general a more "reactive" way)?
Is there any plan to implement a concat_map operator/alias for this functionality?
The text was updated successfully, but these errors were encountered:
Coming from RxJS it was really convenient having the concatMap operator to have a pipeline of dynamic observables that wait for the previous to complete. I noticed that RxPY does not have an obvious equivalent (closest is flat_map but I can't have interleaving).
From what relevant docs/issues I could find, it seems that the following would achieve the same functionality but feels dirty. The
of(...)
's are a stand-in for some code that would dynamically generate a new observable depending on the result from the previous.Is there a better way to achieve this currently (or in general a more "reactive" way)?
Is there any plan to implement a concat_map operator/alias for this functionality?
The text was updated successfully, but these errors were encountered: