Skip to content

Commit

Permalink
Allow fold_range_wait in snapshot mode (#14)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kocolosk authored Mar 1, 2021
1 parent efef20c commit c8958c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/erlfdb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down

0 comments on commit c8958c9

Please sign in to comment.