dispatch event start method based on event format type
322716
def get_event_start(event_buffer, event_format):
    

    if event_format == "csv":
        return get_csv_event_start(event_buffer)
    elif event_format == "xml":
        return get_xml_event_start(event_buffer)
    else:
        return get_json_event_start(event_buffer)
715591
function (type, data) {
    if (!_.isString(type)) {
      console.warn('Action types are required when calling dispatcher.dispatch()');
      return;
    }

    this.dispatcher.dispatch({
      type: type,
      data: data
    });
  }
1130223
public void dispatch_event(final EventData eventData) {
        final TangoInterfaceChange interfaceChange = 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() {
                    fireTangoInterfaceChangeEvent(interfaceChange, eventData);
                }
            };
            SwingUtilities.invokeLater(do_work_later);
        }
        else {
            fireTangoInterfaceChangeEvent(interfaceChange, eventData);
        }
    }
560801
public void dispatchEvent(IEvent event) {
        if (event instanceof IRTMPEvent && !closed.get()) {
            switch (event.getType()) {
                case STREAM_CONTROL:
                case STREAM_DATA:
                    // create the event
                    IRTMPEvent rtmpEvent;
                    try {
                        rtmpEvent = (IRTMPEvent) event;
                    } catch (ClassCastException e) {
                        log.error("Class cast exception in event dispatch", e);
                        return;
                    }
                    int eventTime = rtmpEvent.getTimestamp();
                    // verify and / or set source type
                    if (rtmpEvent.getSourceType() != Constants.SOURCE_TYPE_LIVE) {
                        rtmpEvent.setSourceType(Constants.SOURCE_TYPE_LIVE);
                    }
                    /*
                    if (log.isTraceEnabled()) {
                        // If this is first packet save its timestamp; expect it is
                        // absolute? no matter: it's never used!
                        if (firstPacketTime == -1) {
                            firstPacketTime = rtmpEvent.getTimestamp();
                            log.trace(String.format("CBS=@%08x: rtmpEvent=%s creation=%s firstPacketTime=%d", System.identityHashCode(this), rtmpEvent.getClass().getSimpleName(), creationTime, firstPacketTime));
                        } else {
                            log.trace(String.format("CBS=@%08x: rtmpEvent=%s creation=%s firstPacketTime=%d timestamp=%d", System.identityHashCode(this), rtmpEvent.getClass().getSimpleName(), creationTime, firstPacketTime, eventTime));
                        }
                    }
                    */
                    //get the buffer only once per call
                    IoBuffer buf = null;
                    if (rtmpEvent instanceof IStreamData && (buf = ((IStreamData<?>) rtmpEvent).getData()) != null) {
                        bytesReceived += buf.limit();
                    }
                    // get stream codec
                    IStreamCodecInfo codecInfo = getCodecInfo();
                    StreamCodecInfo info = null;
                    if (codecInfo instanceof StreamCodecInfo) {
                        info = (StreamCodecInfo) codecInfo;
                    }
                    //log.trace("Stream codec info: {}", info);
                    if (rtmpEvent instanceof AudioData) {
                        //log.trace("Audio: {}", eventTime);
                        IAudioStreamCodec audioStreamCodec = null;
                        if (checkAudioCodec) {
                            // dont try to read codec info from 0 length audio packets
                            if (buf.limit() > 0) {
                                audioStreamCodec = AudioCodecFactory.getAudioCodec(buf);
                                if (info != null) {
                                    info.setAudioCodec(audioStreamCodec);
                                }
                                checkAudioCodec = false;
                            }
                        } else if (codecInfo != null) {
                            audioStreamCodec = codecInfo.getAudioCodec();
                        }
                        if (audioStreamCodec != null) {
                            audioStreamCodec.addData(buf);
                        }
                        if (info != null) {
                            info.setHasAudio(true);
                        }
                    } else if (rtmpEvent instanceof VideoData) {
                        //log.trace("Video: {}", eventTime);
                        IVideoStreamCodec videoStreamCodec = null;
                        if (checkVideoCodec) {
                            videoStreamCodec = VideoCodecFactory.getVideoCodec(buf);
                            if (info != null) {
                                info.setVideoCodec(videoStreamCodec);
                            }
                            checkVideoCodec = false;
                        } else if (codecInfo != null) {
                            videoStreamCodec = codecInfo.getVideoCodec();
                        }
                        if (videoStreamCodec != null) {
                            videoStreamCodec.addData(buf, eventTime);
                        }
                        if (info != null) {
                            info.setHasVideo(true);
                        }
                    } else if (rtmpEvent instanceof Invoke) {
                        //Invoke invokeEvent = (Invoke) rtmpEvent;
                        //log.debug("Invoke action: {}", invokeEvent.getAction());
                        // event / stream listeners will not be notified of invokes
                        return;
                    } else if (rtmpEvent instanceof Notify) {
                        Notify notifyEvent = (Notify) rtmpEvent;
                        String action = notifyEvent.getAction();
                        //if (log.isDebugEnabled()) {
                        //log.debug("Notify action: {}", action);
                        //}
                        if ("onMetaData".equals(action)) {
                            // store the metadata
                            try {
                                //log.debug("Setting metadata");
                                setMetaData(notifyEvent.duplicate());
                            } catch (Exception e) {
                                log.warn("Metadata could not be duplicated for this stream", e);
                            }
                        }
                    }
                    // update last event time
                    if (eventTime > latestTimeStamp) {
                        latestTimeStamp = eventTime;
                    }
                    // notify event listeners
                    checkSendNotifications(event);
                    // note this timestamp is set in event/body but not in the associated header
                    try {
                        // route to live
                        if (livePipe != null) {
                            // create new RTMP message, initialize it and push through pipe
                            RTMPMessage msg = RTMPMessage.build(rtmpEvent, eventTime);
                            livePipe.pushMessage(msg);
                        } else if (log.isDebugEnabled()) {
                            log.debug("Live pipe was null, message was not pushed");
                        }
                    } catch (IOException err) {
                        stop();
                    }
                    // notify listeners about received packet
                    if (rtmpEvent instanceof IStreamPacket) {
                        for (IStreamListener listener : getStreamListeners()) {
                            try {
                                listener.packetReceived(this, (IStreamPacket) rtmpEvent);
                            } catch (Exception e) {
                                log.error("Error while notifying listener {}", listener, e);
                                if (listener instanceof RecordingListener) {
                                    sendRecordFailedNotify(e.getMessage());
                                }
                            }
                        }
                    }
                    break;
                default:
                    // ignored event
                    //log.debug("Ignoring event: {}", event.getType());
            }
        } else {
            log.debug("Event was of wrong type or stream is closed ({})", closed);
        }
    }
172548
protected void processStart(Endpoint endpoint, EventTypeEnum eventType) {
        if (!sendLifecycleEvent) {
            return;
        }

        Event event = createEvent(endpoint, eventType);
        queue.add(event);
    }
108010
private void dispatchEditEvent(MessageEditEvent event) {
        Optional<Server> optionalServer =
                event.getChannel().asServerChannel().map(ServerChannel::getServer);
        api.getEventDispatcher().dispatchMessageEditEvent(
                optionalServer.map(DispatchQueueSelector.class::cast).orElse(api),
                event.getMessageId(),
                optionalServer.orElse(null),
                event.getChannel(),
                event);
    }
1327737
function handleEvent(eventDetails){

  createEventInMongo(eventDetails);
  sendAlertEmails(eventDetails);

  /// START Event Types
  if (underscore.contains(startHandler.events, eventDetails.eventType)) { startHandler.handler(eventDetails); }

  /// STOP Event Types
  else if (underscore.contains(stopHandler.events, eventDetails.eventType)) { stopHandler.handler(eventDetails); }

  /// DELETE Event Types
  else if (underscore.contains(deleteHandler.events, eventDetails.eventType)) { deleteHandler.handler(eventDetails); }

  /// CRASH Event Types
  else if (underscore.contains(crashHandler.events, eventDetails.eventType)) { crashHandler.handler(eventDetails); }
}
1035368
function (id, type, elem) {
            var self = this;
            $.each(elem.options.eventHandlers, function (event) {
                if (self.customEventHandlers[event] === undefined) self.customEventHandlers[event] = {};
                if (self.customEventHandlers[event][type] === undefined) self.customEventHandlers[event][type] = {};
                self.customEventHandlers[event][type][id] = elem;
            });
        }
677399
function dispatchEvent (event, data) {
    if (hasDOM()) {
      eventEmitter.dispatchEvent(new CustomEvent(event, data));
    } else if (hasEventEmitter()) {
      eventEmitter.emit(event, data);
    }
  }
1089401
protected <E> void dispatchEvent(E event, Collection<Throwable> errors) {

    @SuppressWarnings({ "unchecked", "rawtypes" })
    Class<E> eventType = (Class) event.getClass();
    EventDispatcher<? super E> eventDispatcher = getEventDispatcherOptional(eventType);
    boolean dispatched = false;
    if (eventDispatcher != null) {
      dispatched = eventDispatcher.handleEvent(event, errors);
    }
    if (!dispatched) {
      handleUndispatchedEvent(event);
    }
  }
482970
def dispatch(self, *args, **kwargs):
        """"""
        action = kwargs.pop('action', 'default')
        action_method = getattr(self, str(action), self.default)
        return action_method(*args, **kwargs)
1258150
public <E> void dispatchEvent (Signal<E> signal, E event) {
    try {
      signal.emit(event);
    } catch (Throwable cause) {
      reportError("Event dispatch failure", cause);
    }
  }
951118
function(view, event_name, event_object) {

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

		if (targets) {

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

		}

	}
971339
def process_event(self, event, client, args, force_dispatch=False):
        
        if not self.running:
            _log.debug("Ignoring '%s' event - controller not running.", event)
            return

        # We keep a copy of the state of loaded modules before this event,
        # and restore it when we're done. This lets us handle events that
        # result in other events being dispatched in a graceful manner.
        old_loaded = self.loaded_on_this_event
        self.loaded_on_this_event = set(old_loaded or []) if not force_dispatch else set()

        try:
            _log.debug("Controller is dispatching '%s' event", event)
            for module_name in self.module_ordering:
                if module_name in self.loaded_on_this_event and not force_dispatch:
                    _log.debug("Not dispatching %s to '%s' because it was just "
                               "loaded (%r).", event, module_name,
                               self.loaded_on_this_event)
                    continue
                module = self.loaded_modules[module_name]
                if module.handle_event(event, client, args):
                    return True
        finally:
            self.loaded_on_this_event = old_loaded
54628
def dispatch(self, event, *args):
        

        for callback in self.listeners.get(event, []):
            if len(args) > 0:
                callback(*args)
            else:
                callback()
23548
function(type, data) {
			if (gui.Type.isString(type)) {
				return this._dispatch({
					type: type,
					data: data,
					global: false
				});
			} else {
				console.error('The "target" argument (the first argument) of gui.Broadcast.dispatch is deprecated');
				this.dispatch(arguments[1], arguments[2]);
			}
		}
447285
function triggerEvent(el, type, options) {
  if (isString(el)) {
    options = type;
    type = el;
    el = document;
  }

  var e = createEvent(type, options);

  el.dispatchEvent
    ? el.dispatchEvent(e)
    : el.fireEvent('on' + type, e);
}