Closed karlsson closed 4 days ago
Sounds like a useful capability to have!
Yes, doesn't it!? :smiley:
That said, I do appreciate gleams restrictive approach to pull in "features", but I think you can argue that this is "almost" necessary...
For the naming I guess that a function name remove_selecting_process_down
is more natural, but if the functions are presented in alphabetical order in the documentation selecting_process_down_remove
will be better placed.
I can make a pull request, let me know if you prefer the other name of the function.
I'm not entirely sure about the name, but we can bike-shed on that one later!
I made a pull request and took the liberty to use yet another function name, so that you can have more options to choose between when bike-shedding! Let me know if I missed something else in the PR.
Love the name!
Hi,
One can add process down messages from monitored processes to a selector with
process.selecting_process_down(selector, monitor, fn(proc_down){...})
but there is no way to remove it. If you start temporary worker processes, upon incoming requests, that you monitor and add to the selector it will grow all the time. Would it be good to have aprocess.selecting_process_down_remove(selector, monitor)
as well? Since you also can demonitor the process it could maybe be good for that case too.I am not sure this is a common case and maybe it can be solved in some other way avoiding the problem. As an example:
Adding to process.gleam:
And to gleam_erlang_ffi.erl: