We're going to be following the discussion and code experiments in this blog post by Piotr Szymański:
A few suggestions before you start:
Tableas in the blog. When you get to the section
Sending messages back and forth between processesput that code in a new module called
Table2and use that name in the tests that follow.
:observer.startPiotr suggests running 100 million processes. Don't. If you do too many sends, the process mailbox can get *very* full when the process can't keep up - my poor 4GB MacBook died. Rather, start small and build up to 1 million (this will still take some time). For example:
p = Table.start 1..100 |> Stream.map(fn _ -> send p, :ping end) |> Enum.count 1..1000 |> Stream.map(fn _ -> send p, :ping end) |> Enum.count #...and so on...
For full credit, show me your iex session after you complete the last section, working with