I’ve been in need for an ets:select_take function. Currently a select of all keys for matching elements followed by a take is required since select_delete returns only the number of deleted elements. Could also do a select/match followed by a delete but that would mean some updates would technically succeed on an element but not be part of what was selected.
Curious if anyone else has encountered need for this and if anyone knows what an implementation would look like.
Yea. An update that happens in another process during the selecting/deleting. So you select the elements, get some element A and in another process A is updated, which succeeds but then A is deleted from the table. Better, in some cases, that the update to A fails instead of being silently lost.