Unpacking Elixir: Concurrency
underjord.io
Unpacking Elixir: Concurrency
1–10 of 138 posts
Re: Unpacking Elixir: Concurrency
#2Re: Unpacking Elixir: Concurrency
#3The thing I like about concurrency in Elixir is that it's there if you need it but it's mostly not mandatory in your code, compared to Javascript where its kind of imposed on you even when it's an hindrance.
I remember one trick I used to do with LiveView on click events etc was to put all async (or "asyncable") code in a spawn function, which would speed up the return.
Re: Unpacking Elixir: Concurrency
#4I liked this approachable talk I watched few years ago. I wish developing in Elixir was as easy as python. https://youtu.be/xoNRtWl4fZU
Re: Unpacking Elixir: Concurrency
#5I liked this approachable talk I watched few years ago. I wish developing in Elixir was as easy as python. https://youtu.be/xoNRtWl4fZU
The achieving tasks in it or the getting paid to do so part?
Re: Unpacking Elixir: Concurrency
#6 def process_items(items) do
items
|> Task.async_stream(&Processor.process/1, max_concurrency: 2, timeout: 7000, on_timeout: :kill_task)
|> Enum.to_list()
end
Semantics of regular and concurrent code is the sameRe: Unpacking Elixir: Concurrency
#7I liked this approachable talk I watched few years ago. I wish developing in Elixir was as easy as python. https://youtu.be/xoNRtWl4fZU
What do you find more difficult? The achieving tasks in it or the getting paid to do so part?
Fortunately there’s Agent/OTP, but again, pretty different than other (or popular with beginners - js/python/java) languages.
Re: Unpacking Elixir: Concurrency
#8Unlike javascript, elixir makes you write synchronous code, e.g. def process_items(items) do items |> Task.async_stream(&Processor.process/1, max_concurrency: 2, timeout: 7000, on_timeout: :kill_task) |> Enum.to_list() end Semantics of regular and concurrent code is the same
Re: Unpacking Elixir: Concurrency
#9Re: Unpacking Elixir: Concurrency
#10I liked this approachable talk I watched few years ago. I wish developing in Elixir was as easy as python. https://youtu.be/xoNRtWl4fZU
Ultimately I am still as fluent with Ruby as before, but I find developing with Elixir is easier than Ruby (it took a few years to get there though).