Fledex.Utils.PubSub (fledex v0.7.0)
View SourceThis module collects all functions that are about publish and subscribe (PubSub) functionality.
PubSub is used for 2 things (more things are likely to be added in the future):
- Notifications related to
triggers (when repaints happen). You can inject into this information flow by callingbroadcast_trigger/1 - Notifications related to
statechanges. Those are triggered mainly by effects, but also an animation can publish them.Fledex.Animation.Coordinators are the main consumer of those events to then take appopriate actions. Those events are published throughbroadcast_state/2
Summary
Functions
Use this function if you want to publish to the state channel
Use this function if you want to publish to the trigger channel
Name of the channel to which state events will be published. State events are those that are related to animations and effects and are important for coordinators.
Name of the channel to which trigger events will be published. Trigger events are those that are related to the redrawing of the led strip
Functions
Use this function if you want to publish to the state channel
See also the channel_state/0 for more informration.
Use this function if you want to publish to the trigger channel
See also the channel_trigger/0 for more informration.
@spec channel_state() :: String.t()
Name of the channel to which state events will be published. State events are those that are related to animations and effects and are important for coordinators.
@spec channel_trigger() :: String.t()
Name of the channel to which trigger events will be published. Trigger events are those that are related to the redrawing of the led strip