 # It handles all the pipes.
 
 defmodule Hermit.Plumber do
+  require Logger
 
   def start_link do
-    # TODO: schedule reap() call.
+    Task.async(&Hermit.Plumber.reap_loop/0)
     Agent.start_link(fn -> initial_state() end, name: __MODULE__)
   end
 

    |> Enum.each(&Kernel.send(&1, { :pipe_activity, content }))
  end

  # Clean up the zombies.
  # TODO: This should be called in a loop every X seconds
  defp reap do
    Agent.update(__MODULE__, fn state ->
      Map.update(state, :pipe_listeners, %{}, fn dict ->
        dict

        |> Enum.into(%{})
      end)
    end)

    reap_loop()
  end

  defp initial_state do
