Created
July 8, 2016 14:42
-
-
Save willrax/64da4ded1ef4042ab06696aaf1d37c95 to your computer and use it in GitHub Desktop.
walnut_event-manager.ex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def site_checked(site = %{status: status}, status) do | |
payload = {:nochange, site, %{}} | |
GenServer.cast(__MODULE__, {:notify, {:site_checked, payload}}) | |
end | |
def site_checked(site = %{status: new_status, reason: reason}, old_status) do | |
payload = {:change, site, %{from: old_status, to: new_status, reason: reason}} | |
GenServer.cast(__MODULE__, {:notify, {:site_checked, payload}}) | |
end | |
def site_checked(site = %{status: new_status}, old_status) do | |
payload = {:change, site, %{from: old_status, to: new_status}} | |
GenServer.cast(__MODULE__, {:notify, {:site_checked, payload}}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment