title: Elixir: How to persist OTP queue if server restarts?
body: <p>I am using OTP for managing a queue of events:</p>
  
  <pre><code>defmodule ParrotApi.MatchingSupervisor do
    use Supervisor
  
    ## Callbacks
  
    def start_link() do
      Supervisor.start_link(__MODULE__, [])
    end
  
    def init(_) do
      children = [
        worker(ParrotApi.MatchingServer, []), # TODO: State is gone if this crashes
  
        # Supervise connections
        supervisor(Registry, [:unique, :connection_registry]),
        supervisor(ParrotApi.ConnectionSupervisor, []),
      ]
  
      supervise(children, strategy: :one_for_one)
    end
  end
  </code></pre>
  
  <p>My question is, if the server restarts, what happens to my queue? I need it to persist after restarting. To my knowledge it is stored in memory so it is wiped if the server restarts.</p>