A finite-state machine with events.