Action called from update production in produced state.
481918
private void actionProduced()
    {
        for (final ProducerListener listener : listeners)
        {
            listener.notifyProduced(currentObject);
        }
        for (final ProducibleListener listener : current.getFeature(Producible.class).getListeners())
        {
            listener.notifyProductionEnded(this);
        }
        currentObject = null;
        progress = -1;

        // Next production
        if (!productions.isEmpty())
        {
            state = ProducerState.CHECK;
        }
        else
        {
            state = ProducerState.NONE;
        }
    }
1041164
def build_action(self, runnable, regime, action):
        

        if isinstance(action, StateAssignment):
            return self.build_state_assignment(runnable, regime, action)
        if isinstance(action, EventOut):
            return self.build_event_out(action)
        if isinstance(action, Transition):
            return self.build_transition(action)
        else:
            return ['pass']
6033
private void updateState(CmsShellCommandResult result) {

        m_errorCode = result.getErrorCode();
        m_prompt = result.getPrompt();
        m_exitCalled = result.isExitCalled();
        m_hasError = result.hasError();
        m_echo = result.hasEcho();
    }
1309578
protected function updateProduct()
    {
        $this->controlAccess('product_edit');

        if ($this->product->update($this->data_product['product_id'], $this->getSubmitted())) {
            $this->redirect('admin/content/product', $this->text('Product has been updated'), 'success');
        }

        $this->redirect('', $this->text('Product has not been updated'), 'warning');
    }
1332170
def handle_update(self, action, params):
    """"""
    _LOGGER.debug('Keypad: "%s" %s Action: %s Params: %s"' % (
                  self._keypad.name, self, action, params))
    if action != Led._ACTION_LED_STATE:
      _LOGGER.debug("Unknown action %d for led %d in keypad %d" % (
          action, self.number, self.keypad.name))
      return False
    elif len(params) < 1:
      _LOGGER.debug("Unknown params %s (action %d on led %d in keypad %d)" % (
          params, action, self.number, self.keypad.name))
      return False
    self._state = bool(params[0])
    self._query_waiters.notify()
    self._dispatch_event(Led.Event.STATE_CHANGED, {'state': self._state})
    return True
850374
def __update_state(self):
    """"""
    # Only if the job was not in a terminal state.
    if self._state.active:
      self._state = self.__get_state_by_id(self.job_config.job_id)
183645
def create_update():
    
    update = upkey("update").setResultsName("action")
    returns, none, all_, updated, old, new = map(
        upkey, ["returns", "none", "all", "updated", "old", "new"]
    )
    return_ = returns + Group(
        none | (all_ + old) | (all_ + new) | (updated + old) | (updated + new)
    ).setResultsName("returns")
    return (
        update
        + table
        + update_expr
        + Optional(keys_in)
        + Optional(where)
        + Optional(using)
        + Optional(return_)
        + Optional(throttle)
    )
320564
def update_done(self, *args, **kwargs):
        """"""
        kwargs['state'] = 'done'
        self.update(*args, **kwargs)
        self.rec = None
178585
def _create_action(factory_self, action_model, resource_name,
                       service_context, is_load=False):
        
        # Create the action in in this closure but before the ``do_action``
        # method below is invoked, which allows instances of the resource
        # to share the ServiceAction instance.
        action = AIOServiceAction(
            action_model, factory=factory_self,
            service_context=service_context
        )

        # A resource's ``load`` method is special because it sets
        # values on the resource instead of returning the response.
        if is_load:
            # We need a new method here because we want access to the
            # instance via ``self``.
            async def do_action(self, *args, **kwargs):
                # response = action(self, *args, **kwargs)
                response = await action.async_call(self, *args, **kwargs)
                self.meta.data = response

            # Create the docstring for the load/reload mehtods.
            lazy_docstring = docstring.LoadReloadDocstring(
                action_name=action_model.name,
                resource_name=resource_name,
                event_emitter=factory_self._emitter,
                load_model=action_model,
                service_model=service_context.service_model,
                include_signature=False
            )
        else:
            # We need a new method here because we want access to the
            # instance via ``self``.
            async def do_action(self, *args, **kwargs):
                response = await action.async_call(self, *args, **kwargs)

                if hasattr(self, 'load'):
                    # Clear cached data. It will be reloaded the next
                    # time that an attribute is accessed.
                    # TODO: Make this configurable in the future?
                    self.meta.data = None

                return response

            lazy_docstring = docstring.ActionDocstring(
                resource_name=resource_name,
                event_emitter=factory_self._emitter,
                action_model=action_model,
                service_model=service_context.service_model,
                include_signature=False
            )

        do_action.__name__ = str(action_model.name)
        do_action.__doc__ = lazy_docstring
        return do_action
1299326
@VisibleForTesting
	void onPartitionStateUpdate(
			IntermediateDataSetID intermediateDataSetId,
			ResultPartitionID resultPartitionId,
			ExecutionState producerState) throws IOException, InterruptedException {

		if (executionState == ExecutionState.RUNNING) {
			final SingleInputGate inputGate = inputGatesById.get(intermediateDataSetId);

			if (inputGate != null) {
				if (producerState == ExecutionState.SCHEDULED
					|| producerState == ExecutionState.DEPLOYING
					|| producerState == ExecutionState.RUNNING
					|| producerState == ExecutionState.FINISHED) {

					// Retrigger the partition request
					inputGate.retriggerPartitionRequest(resultPartitionId.getPartitionId());

				} else if (producerState == ExecutionState.CANCELING
					|| producerState == ExecutionState.CANCELED
					|| producerState == ExecutionState.FAILED) {

					// The producing execution has been canceled or failed. We
					// don't need to re-trigger the request since it cannot
					// succeed.
					if (LOG.isDebugEnabled()) {
						LOG.debug("Cancelling task {} after the producer of partition {} with attempt ID {} has entered state {}.",
							taskNameWithSubtask,
							resultPartitionId.getPartitionId(),
							resultPartitionId.getProducerId(),
							producerState);
					}

					cancelExecution();
				} else {
					// Any other execution state is unexpected. Currently, only
					// state CREATED is left out of the checked states. If we
					// see a producer in this state, something went wrong with
					// scheduling in topological order.
					String msg = String.format("Producer with attempt ID %s of partition %s in unexpected state %s.",
						resultPartitionId.getProducerId(),
						resultPartitionId.getPartitionId(),
						producerState);

					failExternally(new IllegalStateException(msg));
				}
			} else {
				failExternally(new IllegalStateException("Received partition producer state for " +
						"unknown input gate " + intermediateDataSetId + "."));
			}
		} else {
			LOG.debug("Task {} ignored a partition producer state notification, because it's not running.", taskNameWithSubtask);
		}
	}
524571
public void autoTune(Long progress) {
    // LOG.info ("Called auto tune with progress " + progress);

    if (lastAction == ACTION.NOOP) {
      // We did not take any action last time
      if (prevProgress == -1) {
        // The first time around when we are called
        doAction(ACTION.INCREASE, autoTuneFactor, progress);
      } else if (moreThanNum(progress, prevProgress, progressBound)) {
        // We have seen a sudden increase in progress in the steady state (NOOP) try to push
        // the max spout pending limit even more
        doAction(ACTION.INCREASE, autoTuneFactor, progress);
      } else if (lessThanNum(progress, prevProgress, progressBound)) {
        // We have seen a sudden drop in progress in the steady state try to decrease
        // the max spout pending proportionately to see if we can introduce an improvement
        // in progress;
        doAction(ACTION.DECREASE,
            Math.max((prevProgress - progress) / (float) prevProgress, autoTuneFactor), progress);
      } else {
        ++callsInNoop;
        // If the progress remains the same then once in a while try increasing the
        // max spout pending.
        if (callsInNoop >= NOOP_THRESHOLD) {
          doAction(speculativeAction, autoTuneFactor, progress);
          speculativeAction =
              speculativeAction == ACTION.INCREASE ? ACTION.DECREASE : ACTION.INCREASE;
        }
      }
    } else if (lastAction == ACTION.INCREASE) {
      if (moreThanNum(progress, prevProgress, autoTuneFactor - progressBound)) {
        // Our increase last time did result in a commisurate increase. Increase even more
        doAction(ACTION.INCREASE, autoTuneFactor, progress);
      } else if (lessThanNum(progress, prevProgress, progressBound)) {
        // Our increase last time actually resulted in a decrease.
        // Check how much we decreased. If our decrease was disproportionate
        // decrease accordingly.
        float drop = Math.max((prevProgress - progress) / (float) prevProgress, autoTuneFactor);
        if (drop > autoTuneFactor) {
          doAction(ACTION.DECREASE, drop, progress);
        } else {
          doAction(ACTION.RESTORE, autoTuneFactor, progress);
        }
      } else {
        // Our increase last time did not really change anything. So restore.
        doAction(ACTION.RESTORE, autoTuneFactor, progress);
      }
    } else if (lastAction == ACTION.DECREASE) {
      if (moreThanNum(progress, prevProgress, progressBound)) {
        // We actually saw an increase in progress. So decrease more
        doAction(ACTION.DECREASE, autoTuneFactor, progress);
      } else {
        // Hold off any decision. We will take any decision next time around.
        doAction(ACTION.NOOP, autoTuneFactor, progress);
      }
    } else if (lastAction == ACTION.RESTORE) {
      // Lets ignore the effects of the restore and wait out for the next cycle
      doAction(ACTION.NOOP, autoTuneFactor, progress);
    }
  }
557407
@Override
  public void update(DeployService2Impl<I> deploy, Result<I> result)
  {
    LifecycleState state = deploy.getState();
    
    if (state.isStopped()) {
      deploy.startImpl(result);
    }
    else if (state.isError()) {
      deploy.restartImpl(result);
    }
    else if (deploy.isModifiedNow()) {
      deploy.restartImpl(result);
    }
    else { /* active */
      result.ok(deploy.get());
    }
  }
1343931
def perform_action(
            self, action, machines, params, progress_title, success_title):
        """"""
        if len(machines) == 0:
            return 0
        with utils.Spinner() as context:
            return self._async_perform_action(
                context, action, list(machines), params,
                progress_title, success_title)
121078
protected void updated()
    {
        if (remaining < 0 && remaining > capacity)
        {
            throw new IllegalArgumentException(remaining+" illegal remaining at %s"+toString());
        }
        if (marked < 0 && marked > capacity)
        {
            throw new IllegalArgumentException(marked+" illegal marked at %s"+toString());
        }
    }
749536
function update (state) {
    assert.ifError(inRenderingTransaction, 'infinite loop detected')

    // request a redraw for next frame
    if (currentState === null && !redrawScheduled) {
      redrawScheduled = true

      raf(function redraw () {
        redrawScheduled = false
        if (!currentState) return

        inRenderingTransaction = true
        var newTree = view(currentState)
        const patches = vdom.diff(tree, newTree)
        inRenderingTransaction = false

        target = vdom.patch(target, patches)
        tree = newTree
        currentState = null
      })
    }

    // update data for redraw
    currentState = state
  }
1152099
def emitTriggered(self, action):
        
        self.currentActionChanged.emit(action)
        self.currentIndexChanged.emit(self.indexOf(action))
        
        if not self.signalsBlocked():
            self.triggered.emit(action)
188537
protected void updateTransientActions() {
        Vector<Action> ta = new Vector<>();

        for (LabelAtomProperty p : properties)
            ta.addAll(p.getActions(this));

        transientActions = ta;
    }