From c8958c93a8c51a3c62bc931997def083fc61ecc0 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Mon, 1 Mar 2021 08:23:16 -0500 Subject: [PATCH] Allow fold_range_wait in snapshot mode (#14) This is just a convenience function in case the calling code happens to supply an erlfdb_snapshot structure instead of an erlfdb_transaction. It has no actual effect on the semantics since this is merely waiting on the previously-created future. --- src/erlfdb.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/erlfdb.erl b/src/erlfdb.erl index 506b4b0..cbe738f 100644 --- a/src/erlfdb.erl +++ b/src/erlfdb.erl @@ -402,7 +402,10 @@ fold_range_future(?IS_SS = SS, StartKey, EndKey, Options) -> fold_range_wait(?IS_TX = Tx, ?IS_FOLD_FUTURE = FI, Fun, Acc) -> fold_range_int(Tx, FI, fun(Rows, InnerAcc) -> lists:foldl(Fun, InnerAcc, Rows) - end, Acc). + end, Acc); + +fold_range_wait(?IS_SS = SS, ?IS_FOLD_FUTURE = FI, Fun, Acc) -> + fold_range_wait(?GET_TX(SS), FI, Fun, Acc). set(?IS_DB = Db, Key, Value) ->