As it is now you gain nothing from the Task except for the timeout, you could do the work in the GenServer directly and it wouldn’t matter (as long as no timout would happen in the Task)
The more correct way were to put the returned task into your state, alongside the from and return a :noreturn tuple in handle_call/3.
Some time later you will receive a message with either the result of the computation done in the Task, which you then can GenServer(from, answer) to your caller.
Or you might receive a :DOWN, which you will need to find ways to tell your caller about. Most idiomatic way were to use an :error-tuple I think.






















