Tano

Tano

Task.async return message

Currently I am reading Elixir In Action and it is mentioned there for Task.async that the return value of the executed lambda is sent back as a message to the starter process. I am a bit confused here or maybe missed some important part of the text, please correct me if I am wrong: it means that even if i dont care for the return value of the lambda i must have something like handle_info to catch the message that is send back or ? Because if i dont handle the message it will just stay in the mail box forever, thanks guys

Most Liked

Fl4m3Ph03n1x

Fl4m3Ph03n1x

Yes, I found the processes sending the messages, but the methodology we used is not fit for production, unless you don’t mind killing a machine with all the logging or slowing it down considerably.

There are many ways of finding out which process is receiving an unhandled message, but there is no straight way. I have compiled a list of all the relevant posts I created regarding this topic for your convenience, should you ever venture this far into message passing:

Still, if you follow the recommendations for Task.async and Task.await, you will (hopefully) never need this information, unless you are using a 3rd party library that doesn’t follow the conventions (as was our case).

jwarlander

jwarlander

The documentation also suggests several other ways to run tasks, @Tano, if you don’t want this behavior, eg. Task.start_link/1, Task.start/1, or starting tasks under a Task.Supervisor.

Where Next?

Popular in Discussions Top

AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
tmbb
This is a post to discuss the new Phoenix LiveView functionality. From Chris’s talk, it appears that they generate all HTML on the serve...
342 18595 126
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
slashdotdash
Phoenix Live View is now publicly available on GitHub. Here’s Chris McCord’s tweet announcing making it public.
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
thojanssens1
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.: redirect "/", UserController, ...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44167 214
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement