Examples of using Elixir Processes to store and manage state. Includes lesser known Process Dictionary. Used for presenting at a meetup.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
lib
test
.gitignore
LICENSE
README.md
mix.exs

README.md

ProcessState

Examples of using Elixir Processes to store and manage state. Includes lesser known Process Dictionary. I used this for presenting at an Utah Elixir meetup.

Using

Clone or download the repo.

Experiment in IEx and using your preferred editor.

iex -S mix

Example of using the ProcessState.SpawnBasic example.

alias ProcessState.SpawnBasic
pid = SpawnBasic.start(%{counter: 0})
send(pid, {:add, 10})
send(pid, {:add, 1})
send(pid, {:add, 2})

Explanation

I customized Logger output to include some metadata information. Then I use Logger.info to log out information. The logger customization is in config/config.exs.

See the examples directories and single files under the numbered directories.