tristan

tristan

Rebar3 Core Team

ETS table select_take

This is a cross post from the Erlang Forums. ETS table `select_take` - Proposals: Ideas - Erlang Programming Language Forum - Erlang Forums


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.

Most Liked

christhekeele

christhekeele

I’ve noticed this hole in the :ets API as well, though I can’t say I have any idea how to implement. I think it’s a great proposal!

tristan

tristan

Rebar3 Core Team

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.

Where Next?

Popular in Proposals: Ideas Top

alaadahmed
Hi folks, I tried Phoenix 1.7 and it is awesome, but I have small suggestion, which in my opinion will organize files in a better way. ...
New
mxgrn
As one edits a Phoenix LiveView form in a modal, it’s very easy to accidentally press ‘Esc’ and lose all the edits. Similar to data-conf...
New
altdsoy
Hi there :wave:, I hope everyone is doing well… Tl;Dr: Is there a use case to have Heroicons from an actual hex.pm package instead of G...
New
pejrich
I propose adding compact_map/2 to the Enum module. What is it? Sometimes you want to map over a collection, but sometimes you want to ma...
New
GregPhx
Greetings Everyone!!! A little bit of my background so it could be easier to understand where my comments are coming from, and to take t...
New
cgraham
Please change passwordless login from a link to a 6-8 digit code a user can enter. Gen Auth in the latest RC 1.8 of Phoenix defaults ...
New
andypearson
Hey all, I have been working on some performance improvements for the Phoenix application I work on. As part of this, through trial and...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 130286 1222
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement