Dispatch the event, in order, to all interested listeners The most recently mounted component is the first to receive the event Cribbed from a combination of SimpleEventPlugin and EventPluginUtils
347151
function dispatchEvent(event, handlers) {
    for (var i = (handlers.length - 1); i >= 0; i--) {
        if (event.isPropagationStopped()) {
            break;
        }
        var returnValue = handlers[i](event);
        if (returnValue === false) {
            event.stopPropagation();
            event.preventDefault();
        }
    }
}
702305
void fireSynchronousEvent(EventImpl event) {
        boolean useLock = !isReentrant();
        if (useLock) {
            lock.lock();
        }

        try {
            fireEvent(event);
        } finally {
            if (useLock) {
                lock.unlock();
            }
        }
    }
1106267
function forEachEventDispatch(event, cb) {
  var dispatchListeners = event._dispatchListeners;
  var dispatchIDs = event._dispatchIDs;
  if ("production" !== "development") {
    validateEventDispatches(event);
  }
  if (Array.isArray(dispatchListeners)) {
    for (var i = 0; i < dispatchListeners.length; i++) {
      if (event.isPropagationStopped()) {
        break;
      }
      // Listeners and IDs are two parallel arrays that are always in sync.
      cb(event, dispatchListeners[i], dispatchIDs[i]);
    }
  } else if (dispatchListeners) {
    cb(event, dispatchListeners, dispatchIDs);
  }
}
657279
def _do_dispatch(self, listeners, event_type, details):
        """"""
        possible_calls = len(listeners)
        call_failures = 0
        for listener in listeners:
            try:
                listener(event_type, details.copy())
            except Exception:
                self._logger.warn(
                    "Failure calling listener %s to notify about event"
                    " %s, details: %s", listener, event_type, details,
                    exc_info=True)
                call_failures += 1
        return _Notified(possible_calls,
                         possible_calls - call_failures,
                         call_failures)
1282909
final void dispatchToAppender(final String message) {
    // dispatch a copy, since events should be treated as being immutable
    final FoundationFileRollingAppender appender = this.getSource();
    if (appender != null) {
      appender.append(new FileRollEvent(this, message));
    }
  }
30246
protected void dispatch(final MapEvent event) {
		// cancel any pending callback
		if (callback != null) {
			handler.removeCallbacks(callback);
		}
		callback = new CallbackTask(event);

		// set timer
		handler.postDelayed(callback, delay);
	}
516905
private void sendEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager)
    {
        if (this.observationManager != null) {
            this.observationManager.notify(event, componentManager, descriptor);
        }
    }
268452
function executeDispatch(event, listener, domID) {
  event.currentTarget = injection.Mount.getNode(domID);
  var returnValue = listener(event, domID);
  event.currentTarget = null;
  return returnValue;
}
752805
@SuppressWarnings("PMD.SwitchStmtsShouldHaveDefault")
  public void dispatch(@NonNull JCacheEntryEvent<K, V> event) {
    try {
      if (event.getSource().isClosed()) {
        return;
      }
      switch (event.getEventType()) {
        case CREATED:
          onCreated(event);
          return;
        case UPDATED:
          onUpdated(event);
          return;
        case REMOVED:
          onRemoved(event);
          return;
        case EXPIRED:
          onExpired(event);
          return;
      }
      throw new IllegalStateException("Unknown event type: " + event.getEventType());
    } catch (Exception e) {
      logger.log(Level.WARNING, null, e);
    } catch (Throwable t) {
      logger.log(Level.SEVERE, null, t);
    }
  }
296482
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();
    }
781258
def fire_bundle_event(self, event):
        
        with self.__bnd_lock:
            # Copy the list of listeners
            listeners = self.__bnd_listeners[:]

        # Call'em all
        for listener in listeners:
            try:
                listener.bundle_changed(event)
            except:
                self._logger.exception("Error calling a bundle listener")
229523
protected void dispatch() {
    // Event Based ----------------------------------------------------------
    if (isEventBased()) {
      // Current State: IDLE
      // Event: Request in storage
      // Action: Send stored request
      // New State: PENDING_B
      if (buffer != null) {
        setState(ClientRxSessionState.PENDING_BUFFERED);
        try {
          dispatchEvent(new AppRequestEventImpl(messageFromBuffer(ByteBuffer.wrap(buffer))));
        }
        catch (Exception e) {
          try {
            handleSendFailure(e, Event.Type.SEND_EVENT_REQUEST, messageFromBuffer(ByteBuffer.wrap(buffer)));
          }
          catch (Exception e1) {
            logger.error("Failure handling buffer send failure", e1);
          }
        }
      }
    } // Session Based --------------------------------------------------------
    else {
      if (sessionData.getClientRxSessionState() == ClientRxSessionState.OPEN && eventQueue.size() > 0) {
        try {
          this.handleEvent(eventQueue.remove(0));
        }
        catch (Exception e) {
          logger.error("Failure handling queued event", e);
        }
      }
    }
  }
983567
@Override
    public void onPluginEvent(PluginEvent event) {
        ElementPlugin plugin = event.getPlugin();
        
        switch (event.getAction()) {
            case SUBSCRIBE:
                init();
                plugins.add(plugin);
                plugin.setDisabled(isDisabled());
                break;
            
            case UNSUBSCRIBE:
                plugins.remove(plugin);
                plugin.setDisabled(false);
                break;
        }
    }
64533
function(event) {
  if (event) {
    var executeDispatch = EventPluginUtils.executeDispatch;
    // Plugins can provide custom behavior when dispatching events.
    var PluginModule = EventPluginRegistry.getPluginModuleForEvent(event);
    if (PluginModule && PluginModule.executeDispatch) {
      executeDispatch = PluginModule.executeDispatch;
    }
    EventPluginUtils.executeDispatchesInOrder(event, executeDispatch);

    if (!event.isPersistent()) {
      event.constructor.release(event);
    }
  }
}
111824
function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var events;
    var plugins = EventPluginRegistry_1.plugins;
    for (var i = 0; i < plugins.length; i++) {
      // Not every plugin in the ordering may be loaded at runtime.
      var possiblePlugin = plugins[i];
      if (possiblePlugin) {
        var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
        if (extractedEvents) {
          events = accumulateInto_1(events, extractedEvents);
        }
      }
    }
    return events;
  }
1040798
function handleTopLevel(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
    runEventQueueInBatch(events);
  }
1303261
@Override
    public void dispatchEvent(IEvent event) {
        if (log.isDebugEnabled()) {
            log.debug("Event notify: {}", event);
        }
        // determine if its an outgoing invoke or notify
        switch (event.getType()) {
            case CLIENT_INVOKE:
                ClientInvokeEvent cie = (ClientInvokeEvent) event;
                invoke(cie.getMethod(), cie.getParams(), cie.getCallback());
                break;
            case CLIENT_NOTIFY:
                ClientNotifyEvent cne = (ClientNotifyEvent) event;
                notify(cne.getMethod(), cne.getParams());
                break;
            default:
                log.warn("Unhandled event: {}", event);
        }
    }