{"id":16893,"date":"2017-04-12T12:15:45","date_gmt":"2017-04-12T09:15:45","guid":{"rendered":"https:\/\/www.webcodegeeks.com\/?p=16893"},"modified":"2017-04-12T10:51:06","modified_gmt":"2017-04-12T07:51:06","slug":"linking-monitoring-supervising-elixir","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/","title":{"rendered":"Linking, Monitoring, and Supervising in Elixir"},"content":{"rendered":"<p>One of the benefits of microservices is that part of the system can go down without bringing the entire system down.<\/p>\n<p>With Elixir, each process is in essence a microservice. It\u2019s a small, isolated process that communicates with other processes via message passing, all orchestrated by the Erlang BEAM VM.<\/p>\n<p>No memory is shared between processes, so the failure of one process is guaranteed to not effect other processes. But the key ability of Elixir isn\u2019t just how processes work; it\u2019s how they can be linked together, monitor one another, and use supervising functionality to determine what to do if a process fails.<\/p>\n<p>In this article, we will touch on linking, monitoring, and supervisors, with an example of how to implement a simple caching GenServer that\u2019s supervised by a supervisor.<\/p>\n<h2>Linking Processes<\/h2>\n<p>In <a href=\"https:\/\/www.javacodegeeks.com\/2017\/02\/concurrency-in-elixir.html\">Part I of this series<\/a>, we looked at how to spawn a process and execute some code:<\/p>\n<pre class=\"brush:php\">spawn(fn -&gt;\r\n  IO.puts \"In #{inspect self()} process\"\r\nend)<\/pre>\n<p>But if this process happens to fail for whatever reason, we\u2019ll never know about it. It is completely isolated and won\u2019t affect our current process at all.<\/p>\n<pre class=\"brush:php\">spawn(fn -&gt;\r\n  IO.puts \"Uh oh...\"\r\n  raise(\"I have failed you.\")\r\nend)\r\n\r\n:timer.sleep(500)\r\nIO.puts \"I'm done.\"<\/pre>\n<p>The reason our process that spawned this code wasn\u2019t affected at all is because they aren\u2019t linked. You\u2019ll notice that it still printed the <code>\"I'm done.\"<\/code> message. Linking ties two or more processes together\u2026if one process fails, so does the process that is linked to it. To begin a new linked process, you change the above code only slightly to call the <code>spawn_link<\/code> function instead.<\/p>\n<pre class=\"brush:php\">spawn_link(fn -&gt;\r\n  IO.puts \"Uh oh...\"\r\n  raise(\"I have failed you.\")\r\nend)\r\n\r\n:timer.sleep(500)\r\nIO.puts \"I'm done.\"<\/pre>\n<p>Now that we have linked the process to our current (<code>self()<\/code>) process, it won\u2019t print the <code>\"I'm done.\"<\/code> message. When the linked process went down, so did our current one. Links are bidirectional. It doesn\u2019t matter which process fails; by linking them, they are both effected.<\/p>\n<p>So what if we actually did want to recover from a failure in a linked process? To do this, we will have to do something called <em>trapping exits<\/em>. When a linked process fails, we are given an opportunity to recover from it. We can listen for exits using a <code>receive<\/code> block, the typical way that messages are passed from one process to another.<\/p>\n<pre class=\"brush:php\">Tell our current process that we want to trap exits\r\nProcess.flag(:trap_exit, true)\r\n\r\n# Spawn a linked process which will fail\r\nspawn_link(fn -&gt;\r\n  IO.puts \"Uh oh...\"\r\n  raise(\"I have failed you.\")\r\nend)\r\n\r\n# Receive the trapped exit message\r\nreceive do\r\n  {:EXIT, pid, :normal} -&gt;\r\n    IO.inspect \"Normal exit from #{inspect pid}\"\r\n  {:EXIT, pid, msg} -&gt;\r\n    IO.inspect \":EXIT received from #{inspect pid}\"\r\n    IO.inspect msg\r\nend\r\n\r\n:timer.sleep(500)\r\nIO.puts \"I'm done.\"<\/pre>\n<p>You\u2019ll notice that in the <code>receive<\/code> block above, I am actually pattern matching for two different <code>:EXIT<\/code> messages. The first one is what happens when a process exits normally upon finishing its task. The second one will catch errors and in our case will output:<\/p>\n<pre class=\"brush:php\">:EXIT received from #PID&lt;0.73.0&gt;\r\n{%RuntimeError{message: \"I have failed you.\"},\r\n [{:elixir_compiler_0, :\"-__FILE__\/1-fun-0-\", 0,\r\n   [file: 'error_linking_traps.exs', line: 5]}]}<\/pre>\n<h2>Monitoring Processes<\/h2>\n<p>Links are bidirectional, but monitoring on the other hand is unidirectional. It allows you to monitor (hence the name) the status of another process without linking yourself to it. You\u2019re observing it at a safe distance. Unlike linking, an error in a monitored process won\u2019t bring down your current one; you\u2019ll just be notified of it.<\/p>\n<pre class=\"brush:php\"># Spawn a new process and grab its pid\r\npid = spawn(fn -&gt;\r\n  :timer.sleep 500\r\n  raise(\"Sorry, my friend.\")\r\nend)\r\n\r\n# Set up a monitor for this pid\r\nref = Process.monitor(pid)\r\n\r\n# Wait for a down message for given ref\/pid\r\nreceive do\r\n  {:DOWN, ^ref, :process, ^pid, :normal} -&gt;\r\n    IO.puts \"Normal exit from #{inspect pid}\"\r\n  {:DOWN, ^ref, :process, ^pid, msg} -&gt;\r\n    IO.puts \"Received :DOWN from #{inspect pid}\"\r\n    IO.inspect msg\r\nend<\/pre>\n<p>We\u2019ll see the following:<\/p>\n<pre class=\"brush:php\">Received :DOWN from #PID&lt;0.73.0&gt;\r\n{%RuntimeError{message: \"Sorry, my friend.\"},\r\n [{:elixir_compiler_0, :\"-__FILE__\/1-fun-0-\", 0,\r\n   [file: 'error_monitoring.exs', line: 3]}]}<\/pre>\n<h2>Supervising<\/h2>\n<p>Linking and monitoring are available when you need them, but Elixir comes with Supervisor functionality. This allows us to easily define what behavior should occur when the code that is being supervised fails. We\u2019ll use an example of a cache store, which fetches the cached value as long as it hasn\u2019t expired.<\/p>\n<p>In the code below, we first fetch the <code>total<\/code> value, providing a function to call if it doesn\u2019t exist or if it has already expired. We then identify the pid of this named process, which is <code>0.109.0<\/code>. After sending a <code>:kill<\/code> message to the process, we then identify the pid again and can see that it is now <code>0.115.0<\/code>. It has automatically been restarted by its supervisor and is now able to fetch the <code>total<\/code> value again (which would need to be recalculated because all state was lost when the process was killed).<\/p>\n<pre class=\"brush:php\">iex(1)&gt; CashMan.Cache.fetch('total', fn -&gt; 20 end)\r\n20\r\niex(2)&gt; pid = Process.whereis(CashMan.Cache)\r\n#PID&lt;0.109.0&gt;\r\niex(3)&gt; Process.exit(pid, :kill)\r\ntrue\r\niex(4)&gt; Process.whereis(CashMan.Cache)\r\n#PID&lt;0.115.0&gt;\r\niex(5)&gt; CashMan.Cache.fetch('total', fn -&gt; 20 end)\r\n20<\/pre>\n<p>Because this example runs as an application, we\u2019ll implement the <code>start<\/code> function which is called automatically. Its job in this case is to start the <code>Supervisor<\/code> module for this application by calling the <code>start_link<\/code> function. Supervisors, like any other concurrent code in Elixir, are simply a specialized process.<\/p>\n<pre class=\"brush:php\">defmodule CashMan do\r\n  use Application\r\n\r\n  def start(_type, _args) do\r\n    CashMan.Supervisor.start_link\r\n  end\r\nend<\/pre>\n<p>The implementation for the <code>Supervisor<\/code> module includes the <code>use Supervisor<\/code> statement. This gives us all of the functionality which comes built in to Elixir for <a href=\"https:\/\/hexdocs.pm\/elixir\/Supervisor.html\">this behavior<\/a>.<\/p>\n<p>We\u2019ll call the <code>start_link<\/code> function that comes with Supervisor, passing it the <code>__MODULE__<\/code> (our current module, to use as the supervising module), an initial value, which in our case is simply <code>:ok<\/code>, and the name of this process.<\/p>\n<p>The <code>init<\/code> function is then called automatically, which is where we can define the exact behavior for this specific supervisor: which children will it supervise, and which strategies should be used in case they fail.<\/p>\n<p>Supervisors can supervise children (GenServers), but they can also supervise other supervisors, creating a supervision hierarchy or tree. <a href=\"http:\/\/benjamintan.io\/\">Benjamin Tan Wei Hao<\/a> produced an <a href=\"https:\/\/raw.githubusercontent.com\/benjamintanweihao\/elixir-cheatsheets\/master\/Supervisor_CheatSheet.pdf\">excellent cheatsheet<\/a> detailing all of the different functions and options for supervisors.<\/p>\n<pre class=\"brush:php\">defmodule CashMan.Supervisor do\r\n  use Supervisor\r\n\r\n  def start_link do\r\n    Supervisor.start_link(__MODULE__, :ok, name: CashMan.Supervisor)\r\n  end\r\n\r\n  def init(:ok) do\r\n    children = [\r\n      worker(CashMan.Cache, [CashMan.Cache])\r\n    ]\r\n\r\n    supervise(children, [strategy: :one_for_one])\r\n  end\r\nend<\/pre>\n<p>A good <a href=\"http:\/\/learnyousomeerlang.com\/supervisors\">overview of the different strategies<\/a> can be found in this article, and although it is speaking about Erlang, the restart strategies are identical in Elixir.<\/p>\n<p>I chose to use <code>:one_for_one<\/code> in the example above because the supervisor is only supervising one child. You would also use this strategy when it is an isolated process that shouldn\u2019t effect any other children that the supervisor is supervising.<\/p>\n<p>Below we have the child, which implements the <a href=\"https:\/\/hexdocs.pm\/elixir\/GenServer.html\">GenServer<\/a> behavior. If you are looking for more details on how a GenServer works, please refer to my previous article on <a href=\"https:\/\/blog.codeship.com\/concurrency-abstractions-in-elixir\/\">Concurrency Abstractions in Elixir<\/a>.<\/p>\n<pre class=\"brush:php\">defmodule CashMan.Cache do\r\n  use GenServer\r\n\r\n  @default_expiry 60\r\n\r\n  def start_link(name) do\r\n    GenServer.start_link(__MODULE__, %{}, name: name)\r\n  end\r\n\r\n  # Allow async fetching, which returns a `Task`,\r\n  # allowing you to call `Task.await()` at a later date.\r\n  def async_fetch(key, func, expiry \\\\ @default_expiry) do\r\n    Task.async(fn -&gt;\r\n      fetch(key, func, expiry)\r\n    end)\r\n  end\r\n\r\n  # Fetch the fresh value for a given key\r\n  # If missing or expired, re-generate a new value and store it in the cache.\r\n  def fetch(key, func, expiry \\\\ @default_expiry) do\r\n    case GenServer.call(__MODULE__, {:fetch, key, expiry}) do\r\n      :missing -&gt;\r\n        value = Task.async(fn -&gt; func.() end) |&gt; Task.await()\r\n        store(key, value, expiry)\r\n        value\r\n      value -&gt; value\r\n    end\r\n  end\r\n\r\n  # Store a given value in the cache, providing its expiry time in seconds\r\n  def store(key, value, expiry) do\r\n    GenServer.cast(__MODULE__, {:store, key, value, expiry})\r\n  end\r\n\r\n  # Remove all expired entries from the cached\r\n  def prune do\r\n    GenServer.cast(__MODULE__, :prune)\r\n  end\r\n\r\n  # Return the current state of the cache\r\n  def current do\r\n    GenServer.call(__MODULE__, :current)\r\n  end\r\n\r\n  # Server\r\n\r\n  def handle_call({:fetch, key, _expiry}, _from, state) do\r\n    {answer, new_state} = case Map.fetch(state, key) do\r\n      {:ok, {expired_at, value}} -&gt;\r\n        case expired?(expired_at) do\r\n          true -&gt; {:missing, Map.delete(state, key)}\r\n          false -&gt; {value, state}\r\n        end\r\n      :error -&gt;\r\n        {:missing, state}\r\n    end\r\n    {:reply, answer, new_state}\r\n  end\r\n\r\n  def handle_call(:current, _from, state) do\r\n    {:reply, state, state}\r\n  end\r\n\r\n  def handle_cast({:store, key, value, expiry}, state) do\r\n    new_state = Map.put(state, key, {calc_expired_at(expiry), value})\r\n    {:noreply, new_state}\r\n  end\r\n\r\n  def handle_cast(:prune, state) do\r\n    new_state = Enum.reduce(state, %{}, fn ({key, {expired_at, value}}, new_state) -&gt;\r\n      if (expired?(expired_at)) do\r\n        new_state\r\n      else\r\n        Map.put(new_state, key, {expired_at, value})\r\n      end\r\n    end)\r\n    {:noreply, new_state}\r\n  end\r\n\r\n  def calc_expired_at(expiry) do\r\n    (DateTime.utc_now() |&gt; DateTime.to_unix()) + expiry\r\n  end\r\n\r\n  def expired?(expired_at) do\r\n    DateTime.to_unix(DateTime.utc_now()) &gt; expired_at\r\n  end\r\nend<\/pre>\n<p>By calling <code>:observer.start<\/code> in any iex console, you will be able to see examples of supervisors. <code>Logging<\/code> contains one which you can explore! Ours from the example above looks like the following:<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/04\/cash-man.png\"><img decoding=\"async\" class=\"aligncenter wp-image-16895\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/04\/cash-man.png\" alt=\"\" width=\"860\" height=\"190\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/04\/cash-man.png 1692w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/04\/cash-man-300x66.png 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/04\/cash-man-768x170.png 768w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/04\/cash-man-1024x226.png 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<h2>Conclusion<\/h2>\n<p>For a deeper dive into the world of Elixir and OTP, I recommend <a href=\"https:\/\/www.manning.com\/books\/the-little-elixir-and-otp-guidebook\"><em>The Little Elixir and OTP Guidebook<\/em><\/a>. It does a great job diving much deeper into each of the subjects we touched on above. The topic of supervisors in Elixir is much deeper and more nuanced than I could have hoped to cover in a single article. As usual, the Elixir website has an excellent <a href=\"http:\/\/elixir-lang.org\/getting-started\/mix-otp\/supervisor-and-application.html\">guide on supervisors<\/a> also.<\/p>\n<p>The cool thing about Elixir is that all of the more advanced\/abstracted functionality is built on top of the building blocks of <em>processes<\/em>, which can <em>link<\/em> themselves to other processes and <em>send<\/em> and <em>receive<\/em> messages from one process to another. Everything else is an abstraction, including a supervisor which is just a specialized GenServer that comes with the language.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"https:\/\/blog.codeship.com\/linking-monitoring-and-supervising-in-elixir\/\">Linking, Monitoring, and Supervising in Elixir<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\">WCG partner<\/a> Leigh Halliday at the <a href=\"http:\/\/blog.codeship.com\/\">Codeship Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>One of the benefits of microservices is that part of the system can go down without bringing the entire system down. With Elixir, each process is in essence a microservice. It\u2019s a small, isolated process that communicates with other processes via message passing, all orchestrated by the Erlang BEAM VM. No memory is shared between &hellip;<\/p>\n","protected":false},"author":113,"featured_media":927,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[309,464],"class_list":["post-16893","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-elixir","tag-erlang"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linking, Monitoring, and Supervising in Elixir - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"One of the benefits of microservices is that part of the system can go down without bringing the entire system down. With Elixir, each process is in\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linking, Monitoring, and Supervising in Elixir - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"One of the benefits of microservices is that part of the system can go down without bringing the entire system down. With Elixir, each process is in\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-12T09:15:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Leigh Halliday\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@leighchalliday\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Leigh Halliday\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/\"},\"author\":{\"name\":\"Leigh Halliday\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/e496b17f78cdca27723b8e225dc6ab6b\"},\"headline\":\"Linking, Monitoring, and Supervising in Elixir\",\"datePublished\":\"2017-04-12T09:15:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/\"},\"wordCount\":1072,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"keywords\":[\"Elixir\",\"Erlang\"],\"articleSection\":[\"Web Dev\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/\",\"name\":\"Linking, Monitoring, and Supervising in Elixir - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"datePublished\":\"2017-04-12T09:15:45+00:00\",\"description\":\"One of the benefits of microservices is that part of the system can go down without bringing the entire system down. With Elixir, each process is in\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Dev\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/web-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Linking, Monitoring, and Supervising in Elixir\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/e496b17f78cdca27723b8e225dc6ab6b\",\"name\":\"Leigh Halliday\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bd40251a1acc424c292c35a3485264a801efa20efa7063c3e320a0a354ddafac?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bd40251a1acc424c292c35a3485264a801efa20efa7063c3e320a0a354ddafac?s=96&d=mm&r=g\",\"caption\":\"Leigh Halliday\"},\"description\":\"Leigh is a developer at theScore. He writes about Ruby, Rails, and software development on his personal site.\",\"sameAs\":[\"http:\/\/www.leighhalliday.com\/\",\"https:\/\/x.com\/leighchalliday\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/leigh-halliday\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linking, Monitoring, and Supervising in Elixir - Web Code Geeks - 2026","description":"One of the benefits of microservices is that part of the system can go down without bringing the entire system down. With Elixir, each process is in","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/","og_locale":"en_US","og_type":"article","og_title":"Linking, Monitoring, and Supervising in Elixir - Web Code Geeks - 2026","og_description":"One of the benefits of microservices is that part of the system can go down without bringing the entire system down. With Elixir, each process is in","og_url":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2017-04-12T09:15:45+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","type":"image\/jpeg"}],"author":"Leigh Halliday","twitter_card":"summary_large_image","twitter_creator":"@leighchalliday","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Leigh Halliday","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/"},"author":{"name":"Leigh Halliday","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/e496b17f78cdca27723b8e225dc6ab6b"},"headline":"Linking, Monitoring, and Supervising in Elixir","datePublished":"2017-04-12T09:15:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/"},"wordCount":1072,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","keywords":["Elixir","Erlang"],"articleSection":["Web Dev"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/","url":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/","name":"Linking, Monitoring, and Supervising in Elixir - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","datePublished":"2017-04-12T09:15:45+00:00","description":"One of the benefits of microservices is that part of the system can go down without bringing the entire system down. With Elixir, each process is in","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/web-development\/linking-monitoring-supervising-elixir\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Dev","item":"https:\/\/www.webcodegeeks.com\/category\/web-development\/"},{"@type":"ListItem","position":3,"name":"Linking, Monitoring, and Supervising in Elixir"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/e496b17f78cdca27723b8e225dc6ab6b","name":"Leigh Halliday","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/bd40251a1acc424c292c35a3485264a801efa20efa7063c3e320a0a354ddafac?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bd40251a1acc424c292c35a3485264a801efa20efa7063c3e320a0a354ddafac?s=96&d=mm&r=g","caption":"Leigh Halliday"},"description":"Leigh is a developer at theScore. He writes about Ruby, Rails, and software development on his personal site.","sameAs":["http:\/\/www.leighhalliday.com\/","https:\/\/x.com\/leighchalliday"],"url":"https:\/\/www.webcodegeeks.com\/author\/leigh-halliday\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/16893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=16893"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/16893\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/927"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=16893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=16893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=16893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}