DEV Community

Discussion on: Understanding the basics of Elixir’s concurrency model

Collapse
 
stojakovic99 profile image
Nikola Stojaković • Edited

Great article Ilija! As someone who has no prior experience in Elixir (just started learning it) nor concurrent programming, I can say that this article was quite helpful to me. I just noticed one minor issue; I think you forgot to put the default clause in example which just loops infinitely.

defmodule Store do
    def start do
        spawn(__MODULE__, :loop, [%{}])
    end

    def loop(state) do
        receive do
            _ ->
                loop(state)
        end
    end
end
Collapse
 
fteem profile image
Ilija Eftimov

Hey Nikola! Thanks for the kind words, I am glad you liked it.

True, it seems like I've skipped the default clause - I will update the article and add it, thanks!