def TerminateExtension(self, status):
     for worker in self.workers:
         worker.running = False
     for worker in self.workers:
         PostQueuedCompletionStatus(self.io_req_port, 0, ISAPI_SHUTDOWN,
                                    None)
     for worker in self.workers:
         worker.join(self.worker_shutdown_wait)
     self.dispatch_map = {}  # break circles
     CloseHandle(self.io_req_port)
 def TerminateExtension(self, status):
     for worker in self.workers:
         worker.running = False
     for worker in self.workers:
         PostQueuedCompletionStatus(self.io_req_port, 0, ISAPI_SHUTDOWN, None)
     # wait for them to terminate - pity we aren't using 'native' threads
     # as then we could do a smart wait - but now we need to poll....
     end_time = time.time() + self.worker_shutdown_wait/1000
     alive = self.workers
     while alive:
         if time.time() > end_time:
             # xxx - might be nice to log something here.
             break
         time.sleep(0.2)
         alive = [w for w in alive if w.is_alive()]
     self.dispatch_map = {} # break circles
     CloseHandle(self.io_req_port)
Esempio n. 3
0
 def HttpExtensionProc(self, control_block):
     overlapped = OVERLAPPED()
     overlapped.object = control_block
     PostQueuedCompletionStatus(self.io_req_port, 0, ISAPI_REQUEST,
                                overlapped)
     return isapicon.HSE_STATUS_PENDING