LP1821094: Add an AngularJS module that runs promises in batches
This service helps to reduce server load for repetitive OpenSRF
calls by dividing a large array of promises into batches. It
maintains the original order of the array when returning results.
Within each batch, calls are sent simultaneously. The batches
themselves are run sequentially.
This represents a middle ground between running a ton of OpenSRF
calls sequentially -- which leads to a long wait for the user --
and running them simultaneously, which can result in some serious
wait times.
One use case is when you need to get several rows from pcrud,
but the order of results is important and can't be just passed
using orderBy.
To use, you can just replace $q.all with egBatchPromises.all
To test:
1) Create a file with 500 or more item barcodes.
2) Load your file into Item Status.
3) Select a few rows.
4) Go to Actions > Edit > Items.
5) Make some changes, then Save and Exit.
6) Time how long it takes between clicking
"Save and Exit" and when the grid actually
refreshes.
7) Repeat steps 2-6, but use Actions > Edit
> Call Numbers instead.
8) Apply this commit.
9) Repeat steps 2-7. The time should be much
faster with this commit.
10) Verify that no columns lose their data
when refreshed, especially monograph parts
and in-house use count.
11) Note that there is also a progress bar.