Finally, we will consider the problem of implementing a non-blocking server again. Here, we are applying the asynchronous generators discussed previously to facilitate the asynchronous reading and handling of data received from clients of the server. The actual code for the server is included in the Chapter18/example6.py file; we will be going through various parts of it, as it is a relatively long program. Let's turn our attention to the global variables that we will have in this program, as follows:
# Chapter18/example6.pyfrom collections import namedtuple############################################################################ ReactorSession = namedtuple('Session', ['address', 'file'])sessions = {} # { ...