   require Logger
   alias FunWithFlags.{Config, Store}
 
-  # Host applications will inject this. It's supposed to be
-  # an active pubsub PID or name atom.
-  @conn Config.pubsub_client()
   @channel "fun_with_flags_changes"
+  @max_attempts 5
 
 
   def worker_spec do

    Task.start(Store, :reload, [name])
    {:noreply, unique_id}
  end
end

end # Code.ensure_loaded?


  def publish_change(flag_name) do
    Task.start fn() ->
      Phoenix.PubSub.broadcast!(client(), @channel,
        {:fwf_changes, {:updated, flag_name, unique_id()}}
      )
    end
