Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmodule MyApplication.Recurring do
- use Task
- def start_link(_arg) do
- Task.start_link(&run/0)
- end
- def run() do
- receive do
- after
- 120_000 ->
- do_work()
- run()
- end
- end
- defp do_work() do
- IO.puts "My recurring work!"
- end
- end
Add Comment
Please, Sign In to add comment