Basic Concepts Of Event Loop Driven Programming

This tutorial might be helpful to you: