A number of code examples with accompanying tests written for the “OTP, Concurrency and Testing Strategies” talk, presented in Montreal Elixir, April 12th, 2017. Slides are available for this talk.
adder
: server to add values and return totalblog
: counter server added to a Phoenix appcalculator
: simple stack calculator servercounter
: shared counter serverstack
: stack server using only primitivestick
: server to demonstrate timed sendswriter
: file writer and reader server
For each example, do iex -S mix
from the project folder:
iex> {:ok, pid} = Counter.start_link
iex> Counter.read pid
iex> Counter.stop pid
For each example, do mix test
to run tests. To run all tests in all examples,
do mix test
from the parent folder.
These examples are released under the MIT license. See LICENSE.