Skip to content

aaronhooper/stack_supervisor_tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Install dependencies with mix deps.get, then open in iex with iex -S mix.

iex(1)> Stack.Server.push "world"
:ok
iex(2)> Stack.Server.push "hello"
:ok
iex(3)> :sys.get_state Stack.Server
{["hello", "world"], #PID<0.152.0>}
iex(4)> Stack.Server.pop
"hello"
iex(5)> :sys.get_state Stack.Server
{["world"], #PID<0.152.0>}
# Stopping the server will save the state.
# When the supervisor restarts the process, the state will be retrieved.
iex(6)> Stack.Server.stop
:ok
iex(7)> :sys.get_state Stack.Server
{["world"], #PID<0.152.0>}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages