November 2022
Intermediate to advanced
294 pages
5h 58m
English
We want to build a supervision tree over the process graph. And we’ll want to use a dynamic supervision tree with a DynamicSupervisor so that we can stand up new nodes and tear them down on demand.
So that’s our supervision tree. But we’ll also want to manage a couple of agent processes for caching the node state and storing the graph as a whole. For these, we can set up a static supervision tree with a regular Supervisor.
We can set up both trees with the start/2 function in lib/graph_compute/application.ex. Let’s create that module now:
| | defmodule GraphCompute.Application do |
| | use Application |
| | |
| | # ... |
| | |
| | end |
And let’s add in our start/2 function:
Read now
Unlock full access