Closed fgmacedo closed 2 months ago
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
ee0be69
) to head (e16c58f
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Observers are now rebranded to {ref}
listeners
. With expanted support for adding listeners when instantiating a state machine. This allows covering more use cases.Listeners at class initialization
Listeners are a way to generically add behavior to a state machine without changing its internal implementation.
Example:
Adding listeners to an instance
Attach listeners to an already running state machine instance using
add_listener
.Exploring our example, imagine that you can implement the LED panel as a listener, that reacts to state changes and turn on/off automatically.
Adding a listener for each traffic light indicator
Now each "LED panel" reacts to changes in state from the state machine: