Beispiel #1
0
 def close(self):
     try:
         notify(EndRequestEvent(None, self))
     finally:
         # subscribers might need the zodb, so `clear` must come afterwards
         # (since `self._held=None` might close the connection, see above)
         self.clear()
Beispiel #2
0
 def endRequest(self, path='/', exception=None, pageid=None, work=None):
     start_event = self._get_start_event(path)
     da.set_request_started()
     profile.start_request(start_event)
     request = start_event.request
     if pageid is not None:
         request.setInWSGIEnvironment('launchpad.pageid', pageid)
     if work is not None:
         work()
     request.response.setResult(EXAMPLE_HTML)
     context = object()
     event = EndRequestEvent(context, request)
     if exception is not None:
         self.eru.raising((type(exception), exception, None), event.request)
     profile.end_request(event)
     da.clear_request_started()
     return event.request
Beispiel #3
0
 def endRequest(self, request, ob):
     endInteraction()
     notify(EndRequestEvent(ob, request))