示例#1
0
文件: exec.py 项目: jbalint/spark
 def executeTask(self, listener, taskname, taskargs):
     if self.agent == None:
         self.agent = G._AGENT
     staskargs = fromXPS(taskargs)
     log_incoming_request(listener, "executeTask",
                          (listener, taskname, staskargs))
     symOrError = taskNameToSymOrError(self.agent, taskname)
     if isString(symOrError):
         requestType = FAIL_REQUEST
         term = symOrError
     else:
         mode = optMode(self.agent, symOrError, ACTION_DO)
         if mode:
             requestType = "d"
             inargs = [
                 _if(usage == TERM_EVAL, x, None)
                 for (x, usage) in zip(staskargs, mode)
             ]
             debug("inargs = %r", inargs)
             term = Structure(symOrError, List(inargs))
         else:
             requestType = FAIL_REQUEST
             term = "Cannot find argument modes"
     #debug("initiating task via (%s, %r, %r, %r)", S_ExecuteTask.id, requestType, listener, term)
     self.agent.add_ephemeral(S_ExecuteTask, requestType, listener, term)
示例#2
0
文件: exec.py 项目: jbalint/spark
 def executingTask(self, parentListener, taskname, taskargs):
     requestId = log_incoming_request(
         None, "executingTask",
         (parentListener, taskname, fromXPS(taskargs)))
     listener = _SparkExecutionListener(self.agent, parentListener)
     debug("creating listener %s with parent %s", listener, parentListener)
     log_outgoing_result(requestId, "result", listener)
     return listener
示例#3
0
文件: exec.py 项目: jbalint/spark
 def executeTask(self, listener, taskname, taskargs):
     if self.agent == None:
        self.agent = G._AGENT
     staskargs = fromXPS(taskargs)
     log_incoming_request(listener, "executeTask", (listener, taskname, staskargs))
     symOrError = taskNameToSymOrError(self.agent, taskname)
     if isString(symOrError):
         requestType = FAIL_REQUEST
         term = symOrError
     else:
         mode = optMode(self.agent, symOrError, ACTION_DO)
         if mode:
             requestType = "d"
             inargs = [_if(usage == TERM_EVAL, x, None)
                       for (x, usage) in zip(staskargs, mode)]
             debug("inargs = %r", inargs)
             term = Structure(symOrError, List(inargs))
         else:
             requestType = FAIL_REQUEST
             term = "Cannot find argument modes"
     #debug("initiating task via (%s, %r, %r, %r)", S_ExecuteTask.id, requestType, listener, term)
     self.agent.add_ephemeral(S_ExecuteTask, requestType, listener, term)
示例#4
0
文件: exec.py 项目: jbalint/spark
 def taskSucceeded(self, boundParameters):
     result = fromXPS(boundParameters)
     log_incoming_result(self, "success", result)
     self.agent.add_ephemeral(S_taskSucceeded, self, result)
示例#5
0
文件: exec.py 项目: jbalint/spark
 def executingTask(self, parentListener, taskname, taskargs):
     requestId = log_incoming_request(None, "executingTask", (parentListener, taskname, fromXPS(taskargs)))
     listener = _SparkExecutionListener(self.agent, parentListener)
     debug("creating listener %s with parent %s", listener, parentListener)
     log_outgoing_result(requestId, "result", listener)
     return listener
示例#6
0
文件: exec.py 项目: jbalint/spark
 def taskSucceeded(self, boundParameters):
     result = fromXPS(boundParameters)
     log_incoming_result(self, "success", result)
     self.agent.add_ephemeral(S_taskSucceeded, self, result)