WeatherflowTempest.PubSub (Weatherflow Tempest v1.0.1)
Publishes events via Phoenix.PubSub.
In order to use Phoenix.PubSub broadcasting you must ensure that your application also require phoenix_pubsub in its deps.
Configure the pubsub you'd like to use in the appropriate config file:
config :weatherflow_tempest, :pubsub_name, MyApp.PubSub
Events are published as an {{:weatherflow, event_type}, event_data} struct, on the "weatherflow:udp" topic. If no pubsub_name is defined in the config, then no PubSub messages are broadcast.
The tuple {:weatherflow, event} is used as they key in order to make it easy to match against all Weatherflow related events if your pubsub subscriber also receives messages from other pubsub topics.
The event
is an expanded version of the event type from the weatherflow API,
and the parsed object as the payload.
Full documentation for the event names and structures is available in the
WeatherflowTempest.Client
module.
Summary
Functions
Return the name of the pubsub we're using. Might be useful if you want to subscribe to the UDP events yourself, or check on which pubsub is being used at runtime
Convenience method to subscribe to the correct pubsub name and channel to receive all parsed UDP events received as pubsub messages.
Functions
get_pubsub_name()
Return the name of the pubsub we're using. Might be useful if you want to subscribe to the UDP events yourself, or check on which pubsub is being used at runtime
subscribe_to_udp_events()
Convenience method to subscribe to the correct pubsub name and channel to receive all parsed UDP events received as pubsub messages.