Prioritizes Triggers called from outside.
490898
def schedule(demand: dict, alterations: set, looped: set=None, altered: set=None):
	""""""
	if looped is not None and len(demand) != len(looped):
		for func in looped: del demand[func]
	if keep_temp in demand:
		demand.pop(increase_temp, None)
		demand.pop(lower_temp, None)
	elif lower_temp in demand:
		demand.pop(increase_temp, None)
	return demand, alterations
43590
public void trigger(String sEvent) {
        if (sEvent.equals("about")) {
            final AboutThread aboutthread = new AboutThread(this.m_xContext);
            aboutthread.start();
        }
    }
3328
private function firePendingEvents()
	{
		if ( ! empty($this->_pendingEvents)) {
			foreach ($this->_pendingEvents as $event) {
				$this->owner->trigger($event->name, $event);
			}
			$this->_pendingEvents = [];

			if ( $this->getStatusAccessor() != null) {
				$this->_statusAccessor->commitStatus($this->owner);
			}
		}
	}
396024
function() {
    var self = this
    self._shouldSyncFromOpts = true
    self.on('update', function() {
      if (self._shouldSyncFromOpts) self.trigger('sync')
      self._shouldSyncFromOpts = true
    })
  }
515669
def trigger(self, event, **kwargs):
        
        with self._handlers.trigger_mutex:
            event = prime_event(event, self.__class__.__name__, **kwargs)

            for handler in self._handlers.async_handlers[event]:
                asynchronous(handler, event)
            for handler in self._handlers.sync_handlers[event]:
                synchronous(handler, event)
576686
def trigger_event(self, event, client, args, force_dispatch=False):
        """"""
        self.controller.process_event(event, client, args, force_dispatch=force_dispatch)
541278
function trigger (dispatcher) {
  var queue = dispatcher.undispatchedEventsQueue || []
  var event;

  // if the last loop is still in progress leave this loop
  if (dispatcher.isRunning) return;

  dispatcher.isRunning = true;

  (function next (e) {

    // dipatch one event in queue and call the _next_ callback, which
    // will call _process_ for the next undispatched event in queue.
    function process (event, nxt) {

      // Publish it now...
      debug('publish event...');
      dispatcher.publisher(event.payload, function(err) {
        if (err) {
          return debug(err);
        }
        // ...and set the published event to dispatched.
        debug('set event to dispatched...');
        dispatcher.store.setEventToDispatched(event, function(err) {
          if (err) {
            debug(err);
          } else {
            debug('event set to dispatched');
          }
        });
      });

      nxt();
    }

    // serial process all events in queue
    if (!e && queue.length) {
      process(queue.shift(), next)
    } else {
      debug(e);
    }
  })();

  dispatcher.isRunning = false;
}
172289
def _trigger_events(view_obj, events_map, additional_kw=None):
    
    if additional_kw is None:
        additional_kw = {}

    event_kwargs = _get_event_kwargs(view_obj)
    if event_kwargs is None:
        return

    event_kwargs.update(additional_kw)
    event_cls = _get_event_cls(view_obj, events_map)
    event = event_cls(**event_kwargs)
    view_obj.request.registry.notify(event)
    return event
933338
function triggerIfHandlerList(handlerList, event) {
    if(handlerList !== undefined) {
        for(var n=0; n<handlerList.length; n++) {
            handlerList[n](event)
        }
    }
}
474976
async def trigger(self, event, kwargs):
        
        await self._queue.put((event, kwargs))
        self._resume_processing.set()
1146499
def trigger(self, name, *args, **kwargs):
        

        # Relevant middleware is cached so we don't have to rediscover it
        # every time. Fetch the cached value if possible.

        listeners = self._triggers.get(name, [])

        # Execute each piece of middleware
        for listener in listeners:
            result = listener(*args, **kwargs)

            if result == break_trigger:
                return False

        return True
276650
public void triggerReload() {
		synchronized (this.monitor) {
			synchronized (this.connections) {
				for (Connection connection : this.connections) {
					try {
						connection.triggerReload();
					}
					catch (Exception ex) {
						logger.debug("Unable to send reload message", ex);
					}
				}
			}
		}
	}
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);
            }
        }
    }
944663
function triggerEvents (list, args, context) {
  var pass = true

  if (list) {
    var i = 0
    var l = list.length
    var a1 = args[0]
    var a2 = args[1]
    var a3 = args[2]
    // call is faster than apply, optimize less than 3 argu
    // http://blog.csdn.net/zhengyinhui100/article/details/7837127
    switch (args.length) {
      case 0: for (; i < l; i += 2) {pass = list[i].call(list[i + 1] || context) !== false && pass} break
      case 1: for (; i < l; i += 2) {pass = list[i].call(list[i + 1] || context, a1) !== false && pass} break
      case 2: for (; i < l; i += 2) {pass = list[i].call(list[i + 1] || context, a1, a2) !== false && pass} break
      case 3: for (; i < l; i += 2) {pass = list[i].call(list[i + 1] || context, a1, a2, a3) !== false && pass} break
      default: for (; i < l; i += 2) {pass = list[i].apply(list[i + 1] || context, args) !== false && pass} break
    }
  }
  // trigger will return false if one of the callbacks return false
  return pass
}
1363129
public void setTriggers(java.util.Collection<Trigger> triggers) {
        if (triggers == null) {
            this.triggers = null;
            return;
        }

        this.triggers = new java.util.ArrayList<Trigger>(triggers);
    }
210731
public static TriggerContext on(Collection<Trigger> triggers) {
        List<Trigger> addedTriggers = new ArrayList<Trigger>();
        if (triggers != null) {
            addedTriggers.addAll(triggers);
        }
        return new TriggerContext(addedTriggers);
    }
120793
def _trigger_event(self, event, namespace, *args):
        """"""
        # first see if we have an explicit handler for the event
        if namespace in self.handlers and event in self.handlers[namespace]:
            return self.handlers[namespace][event](*args)

        # or else, forward the event to a namespace handler if one exists
        elif namespace in self.namespace_handlers:
            return self.namespace_handlers[namespace].trigger_event(
                event, *args)