'Add a callback to the set of callbacks to be called by the
:term:`router` at a point after a :term:`response` object is
successfully created.  :app:`Pyramid` does not have a
global response object: this functionality allows an
application to register an action to be performed against the
response once one is created.
A \'callback\' is a callable which accepts two positional
parameters: ``request`` and ``response``.  For example:
.. code-block:: python
:linenos:
def cache_callback(request, response):
\'Set the cache_control max_age for the response\'
response.cache_control.max_age = 360
request.add_response_callback(cache_callback)
Response callbacks are called in the order they\'re added
(first-to-most-recently-added).  No response callback is
called if an exception happens in application code, or if the
response object returned by :term:`view` code is invalid.
All response callbacks are called *after* the tweens and
*before* the :class:`pyramid.events.NewResponse` event is sent.
Errors raised by callbacks are not handled specially.  They
will be propagated to the caller of the :app:`Pyramid`
router application.
.. seealso::
See also :ref:`using_response_callbacks`.'

def add_response_callback(self, callback):

    self.response_callbacks.append(callback)
