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
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:
- Show all messages in process mailbox assert_receive
- Find out how many unhandled messages a process received - #3 by Fl4m3Ph03n1x
- How to detect wich process is getting unexpected messages? - #7 by sasajuric
- Tracing all calls to handle_info in all processes using recon_trace - #9 by Fl4m3Ph03n1x
- Error when using function in recon_trace.calls
- How to use recon_trace.calls properly?
- Can't get recon_trace to work with anon function - #4 by NobbZ
- Is it possible to use Rexbug to trace messages send/received by processes? - #8 by Fl4m3Ph03n1x
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).
Popular in Discussions
Other popular topics
Chat & Discussions>Discussions
Latest on Elixir Forum
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









