# Do something after Task death

**URL:** <https://forum.elixirforum.com/t/do-something-after-task-death/53172>\
**Category:** Questions\
**Tags:** task, supervisor, dynamicsupervisor\
**Created:** [January 13, 2023, 10:40pm UTC](https://forum.elixirforum.com/t/do-something-after-task-death/53172 "2023-01-13T22:40:34Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![zachallaun](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachallaun/32/29208_2.png) [@zachallaun](https://forum.elixirforum.com/u/zachallaun)\
**Post date:** [January 14, 2023, 12:21am UTC](https://forum.elixirforum.com/t/do-something-after-task-death/53172/5 "2023-01-14T00:21:33Z")

</div>

> [@1stSolo](#):
>
> I just thought that the simplest way to achieve asynchronous things is by using DynamicSupervisor and Task, but they seem to be too limited in their functionality out of the box.

Perhaps you’re used to something like promises that have a success/error callback. That’s just not how the BEAM works, though – the primitives and assumptions are different.

Consider that you _could_ pass a function to the supervisor to run on success/failure of a task. When the supervisor calls your function, what happens if it crashes? It takes down the whole supervisor.

All of these components have been very carefully designed and tested for robustness. Sometimes things seem tricky because there’s a gap in some API or some ergonomics to be improved, but I don’t think that’s the case here.

---

_[View the full topic](https://forum.elixirforum.com/t/do-something-after-task-death/53172)._
