Event-driven example