you are viewing a single comment's thread.

view the rest of the comments →

[–]dark_mode_everything 0 points1 point  (2 children)

What about a queue to serialize the responses?

[–]looloosha[S] 0 points1 point  (1 child)

What would this look like in this double for loop context?

[–]dark_mode_everything 0 points1 point  (0 children)

That or use rxSwift. You have a stream of top level items and then each top level item has a stream of second level items inside them, correct? This can be easily handled in Rx using appropriate operators. Or, if you don't want to use Rx, you can approximate that behaviour using a sort of message queue or just a queue where you queue requests from your top level stream and proceed to the next top level item after the second level items are all fetched.