Current section

Files

Jump to
smart_city_registry lib smart_city registry message_handler.ex
Raw

lib/smart_city/registry/message_handler.ex

defmodule SmartCity.Registry.MessageHandler do
@moduledoc """
Behaviour/macro for handling messages received from the registry.
See `SmartCity.Registry.Subscriber`
"""
@callback handle_dataset(dataset :: SmartCity.Dataset.t()) :: term
@callback handle_organization(organization :: SmartCity.Organization.t()) :: term
defmacro __using__(_opts) do
quote do
@behaviour SmartCity.Registry.MessageHandler
def handle_dataset(_msg) do
nil
end
def handle_organization(_msg) do
nil
end
defoverridable SmartCity.Registry.MessageHandler
end
end
end