Let me explain what’s hapenning. I have an app for auditing. It has an auditing model with around 50 auditing itens. Every item has it’s own json document and the user may take let’s say 2 pictures. Now I have 50 docs with 100 pics., around 100mb in data. No problem so far, because every item is a distinct doc so it’s 1 doc with 2 mb each. The user finishes auditing and then will try to sync all data through 3G (yes, I’m in Brazil, internet sucks at most places). The device will try to sync now, it’ll send let’s say 10 itens at once, around 20MB at speed of 128KB/s, which means every doc will sync at speed of 13KB/s, which will take around 160 seconds. The problem now is network/firewall will drop the connection after around 100 seconds, and then a lot of downloads will be lost almost at the end.
If I could define how many concurrent uploads could be performed we could bypass the network problem (unfortunately I cannot change the network config from my client).
Maybe I expressed incorrectly at first time. What I’d really like to is control the amount of documents uploaded concurrently. I even got to place a Thread.sleep in the CBL sync filter. It works and I can block other itens from being uploaded when the syncing starts, but this is ugly as hell.
Thanks for your time and sorry for the long text.