コード例 #1
0
ファイル: exec.py プロジェクト: jbalint/spark
                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)

    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


XPSExecutor.setSparkExecutor(_SparkExecutor())


def setLoopback():  # for testing only
    XPSExecutor.setNonsparkExecutor(XPSExecutor.getSparkExecutor())


def startExecuteTask(agent, listener, taskname, arguments):
    if not isinstance(listener, ExecutionListener):
        listener = None
    newlistener = _SparkExecutionListener(agent, listener)
    debug("creating listener %s with parent %s", newlistener, listener)
    executor = XPSExecutor.getNonsparkExecutor()
    if executor == None:
        raise LowError("XPSExecutor nonsparkExecutor is not set")
    larguments = List(arguments)
コード例 #2
0
ファイル: exec.py プロジェクト: jbalint/spark
                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)

    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

XPSExecutor.setSparkExecutor(_SparkExecutor())

def setLoopback():                      # for testing only
    XPSExecutor.setNonsparkExecutor(XPSExecutor.getSparkExecutor())

def startExecuteTask(agent, listener, taskname, arguments):
    if not isinstance(listener, ExecutionListener):
        listener = None
    newlistener = _SparkExecutionListener(agent, listener)
    debug("creating listener %s with parent %s", newlistener, listener)
    executor = XPSExecutor.getNonsparkExecutor()
    if executor == None:
        raise LowError("XPSExecutor nonsparkExecutor is not set")
    larguments = List(arguments)
    log_outgoing_request(newlistener, "executeTask", (newlistener, taskname, larguments))
    executor.executeTask(newlistener, taskname, toXPS(larguments))