Add API to refresh the LastFm feed

This commit is contained in:
Claudio Ortolina
2024-11-17 21:35:06 +00:00
parent 659894aaee
commit 1936075bc0
+6
View File
@@ -17,6 +17,12 @@ defmodule LastFm.Refresh do
GenServer.start_link(__MODULE__, config, name: __MODULE__)
end
@spec refresh() :: :refresh
def refresh do
# Very barebones and naive - can be improved by building a state machine.
send(__MODULE__, :refresh)
end
@impl true
@spec init(config) :: {:ok, config, {:continue, :refresh}} | :ignore
def init(config) do