How can I schedule code to run every few hours in Elixir or Phoenix framework?

There is a simple alternative that does not require any external dependencies: defmodule MyApp.Periodically do use GenServer def start_link(_opts) do GenServer.start_link(__MODULE__, %{}) end def init(state) do schedule_work() # Schedule work to be performed at some point {:ok, state} end def handle_info(:work, state) do # Do the work you desire here schedule_work() # Reschedule once more … Read more

Integer List printed as String in Elixir

The value you see ‘efgh’ is not a String but a Charlist. The result of your statement should be [101, 102, 103, 104] (and it actually is), but it doesn’t output it that way. The four values in your list map to e, f, g and h in ASCII, so iex just prints their codepoints … Read more