Exemple #1
0
    def _make_routing_call(self, call, timeout, *op_args, **op_kwargs):
        if not self._routing_call:
            return RPCResponseEndpointUnit._make_routing_call(
                self, call, timeout, *op_args, **op_kwargs)

        ctx = self._process.get_context(
        )  # pull onto the locals here, for debuggability with manhole
        ar = self._routing_call(call, ctx, *op_args, **op_kwargs)
        res = ar.get()  # REMOVED TIMEOUT
        #try:
        #    res = ar.get(timeout=timeout)
        #except Timeout:
        #
        #    # cancel or abort current processing
        #    self._process._process.cancel_or_abort_call(ar)
        #
        #    raise IonTimeout("Process did not execute in allotted time")    # will be returned to caller via messaging

        # Persistent process state handling
        if hasattr(self._process, "_proc_state"):
            if self._process._proc_state_changed:
                log.debug("Process %s state changed. State=%s",
                          self._process.id, self._process._proc_state)
                self._process.container.state_repository.put_state(
                    self._process.id, self._process._proc_state)
                self._process._proc_state_changed = False
        return res
Exemple #2
0
    def _make_routing_call(self, call, *op_args, **op_kwargs):
        if not self._routing_call:
            return RPCResponseEndpointUnit._make_routing_call(
                self, call, *op_args, **op_kwargs)

        ar = self._routing_call(call, self._process.get_context(), *op_args,
                                **op_kwargs)
        return ar.get()  # @TODO: timeout?
Exemple #3
0
    def _make_routing_call(self, call, timeout, *op_args, **op_kwargs):
        if not self._routing_call:
            return RPCResponseEndpointUnit._make_routing_call(self, call, timeout, *op_args, **op_kwargs)

        ctx = self._process.get_context()
        ar = self._routing_call(call, ctx, *op_args, **op_kwargs)
        res = ar.get()
        # REMOVED TIMEOUT
        #try:
        #    res = ar.get(timeout=timeout)
        #except Timeout:
        #    # cancel or abort current processing
        #    self._process._process.cancel_or_abort_call(ar)
        #    raise IonTimeout("Process did not execute in allotted time")    # will be returned to caller via messaging

        # Persistent process state handling
        if hasattr(self._process, "_proc_state"):
            if self._process._proc_state_changed:
                log.debug("Process %s state changed. State=%s", self._process.id, self._process._proc_state)
                self._process._flush_state()
        return res
Exemple #4
0
    def _make_routing_call(self, call, op_args):
        if not self._routing_call:
            return RPCResponseEndpointUnit._make_routing_call(self, call, op_args)

        ar = self._routing_call(call, op_args, context=self._process.get_context())
        return ar.get()     # @TODO: timeout?