Guest User

Untitled

a guest
Jun 17th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. defmodule MyApplication.Recurring do
  2. use Task
  3. def start_link(_arg) do
  4. Task.start_link(&run/0)
  5. end
  6. def run() do
  7. receive do
  8. after
  9. 120_000 ->
  10. do_work()
  11. run()
  12. end
  13. end
  14. defp do_work() do
  15. IO.puts "My recurring work!"
  16. end
  17. end
Add Comment
Please, Sign In to add comment