2 ms·
Elixir and its Task module (https://hexdocs.pm/elixir/1.12/Task.html https://hexdocs.pm/elixir/1.12/Task.html) is the best of both worlds here. The fundamental
by rkangel 3y ago
Elixir and its Task module (https://hexdocs.pm/elixir/1.12/Task.html https://hexdocs.pm/elixir/1.12/Task.html) is the best of both worlds here.
The fundamental concurrency system is green threads (similar to Go), which makes for a fantastic programming model where you spend your time writing linear blocking code, while actually having full parallelism. This is achieved both with the VM and the abstractions built on top like GenServers.
The Task module is a convenience that allows you to do "await" type work when that makes sense - because (as you describe) sometimes it does.