Chapter 12Processing the Graph
In the previous chapter, we looked at converting graph models. Now it’s time to come back to Elixir. We’re going to return to native graphs. And we’re going to use some parts of OTP machinery—agents, generic servers (or genservers), and supervisors.
We’re going to have some fun.
Remember back in Basic Workout, when we said that libgraph nodes could contain any Elixir term? Well, that also means we could use an Elixir process as a graph node.
Let’s try something here. Let’s try to create a graph with processes for nodes and then build a supervision tree over that graph. We’ll use genservers for those processes and attach them to a supervisor to manage the process lifecycle.
To keep things simple, let’s reuse ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access