[Proposal] Add support in Task.async for choosing :reply_demonitor over :demonitor

40 views
Skip to first unread message

Ólafur Arason

unread,
Jun 5, 2025, 11:58:20 AMJun 5
to elixir-lang-core
I was trying to understand Process.alias/0 and I went down this rabbit hole.
https://www.erlang.org/eeps/eep-0053

I feel like in a lot of uses of async and await people are just expecting to be sending the result of the command and nothing else. Even though the feature of sending a message through other means is available.

So I feel like we should at least give people the option of using :reply_demonitor for alias in Task.demonitor.

That way they know if they get any message back then everything is shut down. Because I don't think anyone is expecting more than one message or know how to handle it out of the box.

There is just one test in the elixir repo that fails and it's sending a message on it's own back to the process.

I'm also not sure why we don't remove the alias or doing an unmonitor in the down message here:
https://github.com/elixir-lang/elixir/blob/v1.18.4/lib/elixir/lib/task.ex#L883

Regards,
OIaf
Reply all
Reply to author
Forward
0 new messages