'Adds a function to the internal list of functions that should
be called as part of closing down the response.  Since 0.7 this
function also returns the function that was passed so that this
can be used as a decorator.
.. versionadded:: 0.6'

def call_on_close(self, func):

    self._on_close.append(func)
    return func
