title: How to execute asynchronous post-processing in CherryPy?
body: <p><strong>Context:</strong>
  Imagine that you have a standard CherryPy hello word app:</p>
  
  <pre><code>   def index(self):
        return "Hello world!"
     index.exposed = True
  </code></pre>
  
  <p>and you would like to do some post-processing, i.e. record request processing or just log the fact that we were called from specific IP. What you would do is probably:</p>
  
  <pre><code>def index(self):
     self.RunMyPostProcessing()
     return "Hello world!"
  index.exposed = True
  </code></pre>
  
  <p>However, that will add to your request processing time. (btw. And probably you will use decorators, or even some more sophisticated method if you would like to call it on every function).</p>
  
  <p><strong>Question:</strong>
  Is there a way of creating a global threading aware queue (buffer) to which each request can write messages (events) that needs be logged, while some magic function will grab it and post-process? Would you know a pattern for such a thing?</p>
  
  <p>I bet that CherryPy supports something like that :-)</p>
  
  <p>Thank you in advance...</p>