Write messages to response as soon as they arrive. (@jerith).
Fix PEP8 violation (@jerith).