Skip to main content

State Machine

What is a State Machine​

A State Machine is the system that controls the state of an item. It is responsible for ensuring that changes are always predictable and based on the current state.

A real-world example is a traffic light, where state changes are predictable and the next state is always based on the current one.

Vermelho --> Verde
Verde --> Amarelo
Amarelo --> Vermelho