/*
Dispatch events in a manner provided by `control`.

By default, calling `stepping.eventLoop()` with no parameters
dispatches all events in the event queue.
185968
function eventLoop(control) {
        control = control || {};
        control.log = control.log || defaultLog;
        control.fail = control.fail || defaultFail;
        var count = control.count;
        while ((count === undefined) || (--count >= 0)) {
            var effect = options.stepping.dispatch();
            control.log(effect);  // log event
            if (effect === false) {
                return true;  // event queue exhausted
            }
            if (effect.exception) {
                control.fail(effect.exception);  // report exception
            }
        }
        return false;  // limit reached, events may remain
    }
210089
protected function dispatchConfigurationEvents(): self
    {
        foreach ($this->iterationsEvents as $event) {
            if (!($this->loopCount % $event['count'])) {
                $this->dispatchEvent($event['name']);
            }
        }

        return $this;
    }
815383
function onEvent(event) {
    if (event.eventType == nuimotion.Events.GESTURE) {
        console.log("Gesture: " + event.gestureType + " Hand: " + event.hand + " State: " + event.step);
    } else {
        console.log("Event: " + event.eventType);
    }
    for (var c in connections) {
        connections[c].sendUTF(JSON.stringify(event));
    }
}
90891
function _loop(i) {
				var eventName = eventNames[i];
				var actionGroup = instructions[eventName];

				ws.addEventListener(eventName, function (res) {

					processActionGroup({ res: res, actionGroup: actionGroup });

					// TODO handle sending messages
				});
			}
429908
function () {
    // Allow using a function or an object
    var events = _.result(this, 'dispatcherEvents');

    if (_.isUndefined(events) || _.isEmpty(events)) {
      // Bug out early if no dispatcherEvents
      return;
    }

    var registrations = {};
    _.each(events, function (funcOrName, actionType) {
      // Quick sanity check for whether there is a problem with the function/name passed
      if (!(_.isFunction(funcOrName) || _.isFunction(this[funcOrName]))) {
        console.warn('dispatcherEvent: "' + funcOrName + '" is not a function');
        return;
      }

      if (_.isFunction(funcOrName)) {
        registrations[actionType] = funcOrName;
      } else {
        registrations[actionType] = this[funcOrName];
      }

    }.bind(this));

    this.dispatcherToken = dispatcher.register(registrations, this);
  }
1012435
def eventloop(cls, custom_actions=[]):
        
        iiter = cls([None], custom_actions=custom_actions, verbose=False)
        print('[IITER] Begining interactive main loop')
        for _ in iiter:
            pass
        return iiter
1041654
public function dispatch() {
		$params = func_get_args();
		$event = array_shift($params);
		if (strpos('::', $event) === false) {
			$classname = get_called_class();
			$method = $event;
		} else {
			list($classname, $method) = explode('::', $event);
		}
		$event_name = strtolower(str_replace('\\', '_', $classname . '_' . $method));

		$dispatcher = \Skeleton\Event\Dispatcher::get();
		if ($dispatcher->has_listener($event_name) === false) {
			$this->add_listener($event);
		}

		$dispatcher->dispatch($event_name, $params);
	}
408494
public void dispatch_event(final EventData eventData) {
        final TangoAttConfig tangoAttConfig = this;
        if (EventUtil.graphicAvailable()) {
            //   Causes doRun.run() to be executed asynchronously
            //      on the AWT event dispatching thread.
            Runnable do_work_later = new Runnable() {
                public void run() {
                    fireTangoAttConfigEvent(tangoAttConfig,eventData);
                }
            };
            SwingUtilities.invokeLater(do_work_later);
        }
        else
            fireTangoAttConfigEvent(tangoAttConfig, eventData);
   }
1007693
@Override
    public void dispatch(@Nonnull final NessEvent event)
    {
        if (event == null) {
            LOG.trace("Dropping null event");
        }
        else {

            for (final NessEventReceiver receiver : eventReceivers) {
                try {
                    if (receiver.accept(event)) {
                        receiver.receive(event);
                    }
                } catch (Exception e) {
                    // don't reraise. We prefer to not disrupt event handling by other receievers
                    LOG.error(e, "Exception during event handling by %s of event %s", receiver, event);
                }
            }
        }
    }
172150
public function dispatchEvent($eventName, Event $event = null)
    {
        if ($this->eventDispatcher instanceof EventDispatcherInterface) {
            $this->eventDispatcher->dispatch($eventName, $event);
        }
    }
1226437
private void dispatchLegacyEventIfNeeded(ManagerEvent event)
    {
        if (event instanceof DialBeginEvent)
        {
            DialEvent legacyEvent = new DialEvent((DialBeginEvent) event);
            dispatchEvent(legacyEvent);
        }
    }
831781
public void dispatchEvent(VariableEvent variableEvent) {
    boolean invokeCustomListeners =
        Context
          .getProcessEngineConfiguration()
          .isInvokeCustomVariableListeners();

    Map<String, List<VariableListener<?>>> listeners = getActivity()
        .getVariableListeners(variableEvent.getEventName(), invokeCustomListeners);

    // only attempt to invoke listeners if there are any (as this involves resolving the upwards execution hierarchy)
    if (!listeners.isEmpty()) {
      getCaseInstance().queueVariableEvent(variableEvent, invokeCustomListeners);
    }
  }
951118
function(view, event_name, event_object) {

		var targets = view.getContainer().getEventTargets(event_name);

		if (targets) {

			this.dispatchEvent(view, event_name, event_object, targets);

		}

	}
591266
def dispatch_event(self, event, *args):
        
        if event not in self.event_handlers:
            _log.error("Dispatch requested for unknown event '%s'", event)
            return False
        elif event != "LINE":
            _log.debug("Dispatching event %s %r", event, args)

        try:
            for handler in self.event_handlers[event]:
                # (client, server, *args) : args are dependent on event
                if handler(self, *args):
                    # Returning a truthy value supresses further handlers
                    # for this event.
                    return True
        except Exception as e:
            _log.exception("Error while processing event '%s': %r", event, e)

        # Fall back to the RAWLINE event if LINE can't process it.
        if event == "LINE":
            return self.dispatch_event("RAWLINE", *args)

        return False
210833
public void dispatch_event(final EventData eventData) {
        final TangoUser tangoUser = this;
        if (EventUtil.graphicAvailable()) {
            //   Causes doRun.run() to be executed asynchronously
            //      on the AWT event dispatching thread.
            Runnable do_work_later = new Runnable() {
                public void run() {
                    fireTangoUserEvent(tangoUser, eventData);
                }
            };
            SwingUtilities.invokeLater(do_work_later);
        }
        else
            fireTangoUserEvent(tangoUser , eventData);
    }
446998
function() {
	var evt = y.createEvent("MouseEvents");
	evt.initMouseEvent("click", true, true, z,
		0, 0, 0, 0, 0, false, false, false, false, 0, null);

	return !this._node.dispatchEvent(evt);
}
28429
public function dispatch()
    {
        if ($this->isDispatchable()) {

            $sorted = [];

            foreach($this->attachedToEvents as $eventName)
            {
                $sorted[$eventName] = $this->dispatchedEvents[$eventName];
            }

            call_user_func($this->listener, $sorted);
            if ($this->purge) {
                $this->dispatchedEvents = [];
            }
        }
    }