Add capability to exit a head or object fold with a throw

This allows for all fold functions to throw an exception to exit out of a fold with all dependencies still closed down as expected.

This was previously available for key folds, which was necessary for the folds to work in Riak (as max_results in index queries depends one xiting the fold with an exception).  This change now adds a ct test, and adds support for head folds, object folds (key order) and object folds (sqn order)
This commit is contained in:
Martin Sumner 2018-11-23 16:00:11 +00:00
parent da5abb4e4c
commit ef2a8c62af
4 changed files with 224 additions and 32 deletions

View file

@ -451,7 +451,7 @@ pcl_fetchkeysbysegment(Pid, StartKey, EndKey, AccFun, InitAcc,
{fetch_keys,
StartKey, EndKey, AccFun, InitAcc0,
SegmentList, LastModRange, MaxKeys,
as_pcl},
by_runner},
infinity).
-spec pcl_fetchnextkey(pid(),