Skip to content

wsieroci/elixir-cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Cron Service in Elixir

Checking whether given website is alive every couple of seconds

Running observer by connecting to running host (example)

Executing actions on running instance

Cron.WebsiteChecker.set(:simple_checker, 101)

Code reloading

  • :sys.suspend(:simple_checker)
  • c "lib/cron/website_checker.ex"
  • :sys.change_code(:simple_checker, Cron.WebsiteChecker, "https://www.polidea.com", [:param])
  • :sys.resume(:simple_checker)

Many nodes

  • iex --sname node1

  • iex --sname node2

  • iex --sname node3

  • Node.connect :"node2@Wiktors-MacBook-Pro-2"

  • Node.connect :"node3@Wiktors-MacBook-Pro-2"

  • Node.list

  • :rpc.multicall(:inets, :start, [])

  • :rpc.multicall(:httpc, :request, ['http://api.icndb.com/jokes/random'])

About

Sample cron service in Elixir

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages