示例#1
0
 def dispatcherProcess(commqueue, controls):
     #A process that handles requests
     request = commqueue.get()
     while not request == CMD_HALT:
         #print(request)
         try:
             handlerList[request.getType()](request, controls)
         except DeadWorkerError as error:
             commqueue.put(Request(CMD_WORKER_DIED, {"WORKER": error.id}))
         request.close()
         request = commqueue.get()
示例#2
0
def requestHandler(request):
    handlers[request.getType()](request)
    request.close()