Dispatches an event to all Listeners registered to this Signal
@param object The object to send off
492125
public void dispatch (T object) {
		final Object[] items = listeners.begin();
		for (int i = 0, n = listeners.size; i < n; i++) {
			Listener<T> listener = (Listener<T>)items[i];
			listener.receive(this, object);
		}
		listeners.end();
	}
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);
                }
            }
        }
    }
980018
public function dispatch($event, $payload = array(), $halt = false)
    {
        $responses = array();

        // When the given "event" is actually an object we will assume it is an event
        // object and use the class as the event name and this event itself as the
        // payload to the handler, which makes object based events quite simple.
        if (is_object($event)) {
            list($payload, $event) = array(array($event), get_class($event));
        }

        // If an array is not given to us as the payload, we will turn it into one so
        // we can easily use call_user_func_array on the listeners, passing in the
        // payload to each of them so that they receive each of these arguments.
        else if (! is_array($payload)) {
            $payload = array($payload);
        }

        $this->dispatching[] = $event;

        if (isset($payload[0]) && ($payload[0] instanceof ShouldBroadcastInterface)) {
            $this->broadcastEvent($payload[0]);
        }

        foreach ($this->getListeners($event) as $listener) {
            $response = call_user_func_array($listener, $payload);

            // If a response is returned from the listener and event halting is enabled
            // we will just return this response, and not call the rest of the event
            // listeners. Otherwise we will add the response on the response list.
            if (! is_null($response) && $halt) {
                array_pop($this->dispatching);

                return $response;
            }

            // If a boolean false is returned from a listener, we will stop propagating
            // the event to any further listeners down in the chain, else we keep on
            // looping through the listeners and dispatching every one in our sequence.
            if ($response === false) {
                break;
            }

            $responses[] = $response;
        }

        array_pop($this->dispatching);

        if (! $halt) {
            return $responses;
        }
    }
135506
protected synchronized void fireMPDChangeEvent(MPDChangeEvent.Event event) {
        MPDChangeEvent mce = new MPDChangeEvent(this, event);

        for (MPDChangeListener mcl : listeners) {
            mcl.mpdChanged(mce);
        }
    }
355360
function(object, name) {
		if (edb.$accessaware) {
			gui.Broadcast.dispatch(edb.BROADCAST_ACCESS, [
				object, name
			]);
		}
	}
1343022
function(view, event_name, event_object, targets) {

		this._dispatchCallback(
			view,
			targets,
			this._callHandleEvent,
			{
				event_name: event_name,
				event_object: event_object
			},
			this._global_event_targets
		);

	}
391293
protected void dispatchEvents() {

    while (true) {

      Object event = this.eventQueue.poll();
      if (event == null) {
        return;
      }
      Collection<Throwable> errors = new LinkedList<>();
      dispatchEvent(event, errors);
      if (!errors.isEmpty()) {
        handleErrors(errors, event);
      }
    }
  }
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);
        }
    }
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();
        }
    }
}
1065409
public void dispatchEvent(IEvent event) {
        for (IEventListener listener : listeners) {
            if (event.getSource() == null || event.getSource() != listener) {
                listener.notifyEvent(event);
            }
        }
    }
657543
function globalEventHandler(event) {
    if (listeners[event.type]) {
      listeners[event.type].forEach(function(currentHandler) {
        currentHandler.call(this, event);
      }, this);
    }
  }
1075920
protected void handleUpdatedObject(final Object object) {
		runWithWriteLock(new Runnable() {
			public void run() {
				int index = getFinalEventList().indexOf(object);
				if (index >= 0) {
					getFinalEventList().set(index, object);
				}
			}
		});
	}
525758
function _addEvent(object, type, callback) {
        if (object.addEventListener) {
            object.addEventListener(type, callback, false);
            return;
        }

        object.attachEvent('on' + type, callback);
    }
839149
function(handlers) {
				var h;
						
				if (Basic.typeOf(handlers) !== 'array') {
					handlers = [handlers];
				}

				for (var i = 0; i < handlers.length; i++) {
					h = 'on' + handlers[i];
					
					if (Basic.typeOf(this[h]) === 'function') {
						this.addEventListener(handlers[i], this[h]);
					} else if (Basic.typeOf(this[h]) === 'undefined') {
						this[h] = null; // object must have defined event properties, even if it doesn't make use of them
					}
				}
			}
471781
function(object, events, callback) {
      var listeners = this._listeners;
      if (!listeners) return;
      if (object) {
        object.off(events, callback, this);
        if (!events && !callback) delete listeners[object._listenerId];
      } else {
        for (var id in listeners) {
          listeners[id].off(null, null, this);
        }
        this._listeners = {};
      }
      return this;
    }
336838
@Override
    public void visitAfter(JavaClass obj) {
        isListenerMethod = true;
        for (Code l : listenerCode.keySet()) {
            try {
                super.visitCode(l);
            } catch (StopOpcodeParsingException e) {
                // method already reported
            }
        }
        super.visitAfter(obj);
    }
273811
@Override
	public void on(String name, Tree payload, Groups groups, boolean broadcast) throws Exception {

		// A.) Async invocation
		if (asyncLocalInvocation) {
			executor.execute(() -> {
				try {
					listener.on(payload);
				} catch (Exception cause) {
					logger.warn("Unable to invoke local listener!", cause);
				}
			});
			return;
		}

		// B.) Faster in-process (direct) invocation
		listener.on(payload);
	}