Add a Supervision Tree
Learn how to build a dynamic supervision tree over the process graph.
Our plan
We want to build a supervision tree over the process graph. And we want to use a dynamic supervision tree with a DynamicSupervisor
so that we can stand up new nodes and tear down on demand.
So that’s our supervision tree. But we also want to manage a couple of agent processes for caching node state and storing the graph as a whole. For these, we can set up a static supervision tree with a regular Supervisor
.
The GraphCompute.Appliation
module
We can set up both trees with the start/2
function in lib/graph_compute/application.ex
. Let’s create that module now:
Get hands-on with 1200+ tech skills courses.