Fire a trigger to the state machine
181913
protected void fireTrigger(final ReplicationTrigger trigger) {
        Log.d(Log.TAG_SYNC, "%s [fireTrigger()] => " + trigger, this);
        // All state machine triggers need to happen on the replicator thread
        synchronized (executor) {
            if (!executor.isShutdown()) {
                executor.submit(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            Log.d(Log.TAG_SYNC, "firing trigger: %s", trigger);
                            stateMachine.fire(trigger);
                        } catch (Exception e) {
                            Log.i(Log.TAG_SYNC, "Error in StateMachine.fire(trigger): %s", e.getMessage());
                            throw new RuntimeException(e);
                        }
                    }
                });
            }
        }
    }
947045
private void fireControlPress(int index, int controllerIndex) {
		consumed = false;
		for (int i=0;i<controllerListeners.size();i++) {
			ControllerListener listener = (ControllerListener) controllerListeners.get(i);
			if (listener.isAcceptingInput()) {
				switch (index) {
				case LEFT:
					listener.controllerLeftPressed(controllerIndex);
					break;
				case RIGHT:
					listener.controllerRightPressed(controllerIndex);
					break;
				case UP:
					listener.controllerUpPressed(controllerIndex);
					break;
				case DOWN:
					listener.controllerDownPressed(controllerIndex);
					break;
				default:
					// assume button pressed
					listener.controllerButtonPressed(controllerIndex, (index - BUTTON1) + 1);
					break;
				}
				if (consumed) {
					break;
				}
			}
		}
	}
517652
def fire(self, state):
        
        if self.action is None or self.action == BP_IPDB:
            import ipdb; ipdb.set_trace() #pylint:disable=F0401
        elif self.action == BP_IPYTHON:
            import IPython
            shell = IPython.terminal.embed.InteractiveShellEmbed()
            shell.mainloop(display_banner="This is an ipython shell for you to happily debug your state!\n" + \
                           "The state can be accessed through the variable 'state'. You can\n" +\
                           "make modifications, then exit this shell to resume your analysis.")
        else:
            self.action(state)
29317
function trigger () {
  debug('trigger %j', arguments);
  if (!arguments.length) return;
  var args = slice.call(arguments);
  switch(args.length) {
  case 1:
    debug('one argument');
    emit.apply(this, args);
    break;
  case 2:
    debug('two arguments');
    if (args[1] && args[1].isMessage) {
      debug('it is a message %s', args[1].data.id);
      var msg = common.Message(args[1]);
      debug('vivified %s', msg.id());
      emit.apply(this, [args[0], msg ]); 
    }
    else {
      debug('it is not a message');
      emit.apply(this, args);
    }
    break;
  default:
    debug('more than one argument');
    emit.apply(this, args);
    break;
  }
}
1235164
async def trigger(self, action: str, args: typing.Iterable):
        
        for app in self.applications:
            await app.trigger(action, args)
678377
def call_release(self, arborted=False):
        """"""
        self.was_ended = arborted
        try:
            self.trigger.release()
        except (threading.ThreadError, AttributeError):
            pass
813872
void fireEvent() {
        boolean useLock = !isReentrant();
        if (useLock) {
            lock.lock();
        }
        EventImpl event = eventQueue.poll();

        try {
            if (event != null) {
                fireEvent(event);
            }
        } finally {
            if (useLock) {
                lock.unlock();
            }
        }

    }
1211832
def fire_update_event(self, *args, **kwargs):
        """"""
        for _handler in self._on_update:
            _handler(*args, **kwargs)
565248
def fire_event(event, record, persist, *args)
      handle_state_exit_callback record
      if new_state = transition_to_new_state(record, event, *args)
        handle_state_enter_callback record, new_state
        handle_event_fired_callback record, new_state, event
        record.update_current_state(new_state, persist)
        handle_event_success_callback record, event
        return true
      else
        handle_event_failed_callback record, event
        return false
      end
    rescue => e
      raise e unless record.respond_to?(:event_failed)
      record.send(:event_failed, event)
      return false
    end
898152
public boolean fire(BaseComponent target, Event triggerEvent) {
        CommandEvent event = new CommandEvent(name, triggerEvent, getCommandTarget(target));
        EventUtil.post(event);
        return !event.isStopped();
    }
276646
public static <S extends HasAttachHandlers> void fire(S source, PanelState panelState) {
          if (TYPE != null) {
            JQMPanelEvent event = new JQMPanelEvent(panelState);
            source.fireEvent(event);
          }
        }
1043035
def trigger(self, event, *args, **kw):
        
        observers = self._pool.get(event)

        # If no observers registered for the event, do no-op
        if not observers or len(observers) == 0:
            return None

        # Trigger observers coroutines in FIFO sequentially
        for fn in observers:
            # Review: perhaps this should not wait
            yield from fn(*args, **kw)
1135199
def trigger(event_name, *data, &block)
      trigger!(event_name, *data, &block)
    rescue InvalidStateError, TransitionError, CallbackError
      false
    end
816231
void fireBeforeTriggers(Session session, int trigVecIndex,
                            Object[] oldData, Object[] newData, int[] cols) {

        if (!database.isReferentialIntegrity()) {
            return;
        }

        TriggerDef[] trigVec = triggerLists[trigVecIndex];

        for (int i = 0, size = trigVec.length; i < size; i++) {
            TriggerDef td         = trigVec[i];
            boolean    sqlTrigger = td instanceof TriggerDefSQL;

            if (cols != null && td.getUpdateColumnIndexes() != null
                    && !ArrayUtil.haveCommonElement(
                        td.getUpdateColumnIndexes(), cols, cols.length)) {
                continue;
            }

            if (td.isForEachRow()) {
                switch (td.triggerType) {

                    case Trigger.UPDATE_BEFORE_ROW :
                    case Trigger.DELETE_BEFORE_ROW :
                        if (!sqlTrigger) {
                            oldData =
                                (Object[]) ArrayUtil.duplicateArray(oldData);
                        }
                        break;
                }

                td.pushPair(session, oldData, newData);
            } else {
                td.pushPair(session, null, null);
            }
        }
    }
842420
def trigger (self, event, *args, **kwargs):
        
        if self._events.has_key(event):
            for _callback in self._events[event]:
                try:
                    _callback(args, kwargs)
                except TypeError:
                    _callback()
135549
async def trigger(self, action, args):
        
        handler_name = f"on_{action}"
        handler = getattr(self, handler_name, None)
        if not handler:
            return None
        await handler(*args)
101482
@Override
  public void run() {
    if (isTriggerExpired()) {
      logger.info(this + " expired");
      return;
    }

    final boolean isTriggerConditionMet = this.triggerCondition.isMet();
    if (isTriggerConditionMet) {
      logger.info("Condition " + this.triggerCondition.getExpression() + " met");
      for (final TriggerAction action : this.actions) {
        try {
          action.doAction();
        } catch (final Exception e) {
          logger.error("Failed to do action " + action.getDescription()
              + " for execution " + azkaban.execapp.Trigger.this.execId, e);
        }
      }
    }
  }