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
This also changes the item status refresh code to use
egBatchPromises.all instead of $q.all, in response to some
pcrud-monopolizing noted in
https://bugs.launchpad.net/evergreen/+bug/
1821094/comments/14
Release-note: Improves performance of item refresh after batch editing
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Jennifer Weston <jennifer.weston@equinoxoli.org>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>