Event-driven development and the event loop