Some real examples. Let's say you are making a chat room with
pygtk. Both have their own mainloops, and we'll call each in turn. GTK events can pile up, so that half runs until it is out of events to process. IRClib is less demanding. Though in this example I've omitted all the setup the
irc object requires.