 
   use GenServer
   import Consul.Response, only: [consul_index: 1]
+
+  @retry_ms 5000
 
   def start_link(service) when is_binary(service) do
     GenServer.start_link(__MODULE__, [service])

        end
        :ok       = notify_change(new_nodes, state)
        new_state = %{state | nodes: new_nodes, index: consul_index(response)}
      {:error, response} ->
        new_state = %{state | nodes: [], index: consul_index(response)}
    end

    task = async_poll(self, new_state.index, service)

    {:noreply, %{new_state | task: task}}
  end

  def handle_info({:DOWN, ref, _, _, _}, %{service: service, index: index, task: %Task{ref: ref}} = state) do
    task = async_poll(self, index, service)
    {:noreply, %{state | task: task}}
  end

  def handle_call({:poll_response, results}, _from, %{service: service} = state) do
    case results do
      {:ok, %{body: body} = response} ->
        case Discovery.Node.build(body) do


  @spec poll(pid, binary | integer, binary) :: :ok
  def poll(poller, index, service) do
    Consul.Catalog.service(index, service)
  end

  @spec subscribe(pid, atom, pid) :: :ok
