def CallbackWrapper(wsgi_env, start_response): """Calls the WSGI app and the invokes the request-end callback.""" try: return app(wsgi_env, start_response) finally: callback.InvokeCallbacks()
def callback_wrapper(environ, start_response): """Call the WSGI app and then invoke the request-end callbacks.""" try: return app(environ, start_response) finally: callback.InvokeCallbacks()
def CallbackMiddleware(app, wsgi_env, start_response): """Calls the request-end callback that the app may have set.""" try: return app(wsgi_env, start_response) finally: callback.InvokeCallbacks()