A hot Observable emits items. I want to upload these items to the server. There are two considerations:
- Due to expense of io operations, I want to batch these items and upload as array
- Due to unreliability of io operations, I want failed uploads of batches to be prepended to next batch.
Uploads succeed:
1 - 2 - 3 - 4 - 5
------------------
u(1,2,3) - u(4,5)
First upload fails:
1 - 2 - 3 - 4 - 5
------------------
u(1,2,3) - u(1,2,3,4,5)
I can take care of the first by using the buffer operator, but don't know how to satisfy the second requirement.