Dispatch event to a subscriber, you should not call this method directly.

@param event TangramOp1 object
174986
@Override
    public synchronized void dispatch(@NonNull Event event) {
        String type = event.type;
        List<EventHandlerWrapper> eventHandlers = subscribers.get(type);
        if (eventHandlers != null) {
            EventHandlerWrapper handler = null;
            for (int i = 0, size = eventHandlers.size(); i < size; i++) {
                handler = eventHandlers.get(i);
                if (handler.eventHandlerReceiver != null) {
                    handler.handleEvent(event);
                } else {
                    if (!TextUtils.isEmpty(handler.producer) && handler.producer.equals(event.sourceId)
                            || TextUtils.isEmpty(handler.producer)) {
                        handler.handleEvent(event);
                    }
                }
            }
        }
    }
661504
private void dispatchEvent(XoaEvent event) {
        LOG.entering(CLASS_NAME, "dispatchEvent", event);
        
        try {
            Integer handlerId = event.getHandlerId();
            
            XoaEventKind eventKind = event.getEvent();
            if (LOG.isLoggable(Level.FINEST)) {
                LOG.finest("XOA --> SOA: " + handlerId  + " event: " + eventKind.name());
            }
            
            BridgeDelegate handler = xoaObjectMap.get(handlerId);
            if (handler == null) {
                if (LOG.isLoggable(Level.FINEST)) {
                    LOG.finest("No handler for handler id: " + handlerId);
                }
                return;
            }
            
            /* Allow only one bridge crossing per handler at a time */
            synchronized (handler) {
                // dispatch to SOA
                Object[] args = { handlerId, eventKind.toString(), event.getParams() };
                firePropertyChange(XOP_MESSAGE, null, args);
            }

        } catch (Exception e) {
            LOG.log(Level.FINE, "While dispatching event: "+e.getMessage(), e);
            throw new IllegalStateException("Unable to dispatch an event from the cross origin proxy", e);
        }

    }
346330
public int subscribe_event(int event, int max_size, boolean stateless) throws DevFailed {
        if (!useEvents())
            Except.throw_exception("NO_EVENT", "Event system not available");
        return deviceProxyDAO.subscribe_event(this, event, max_size, stateless);
    }
388540
protected void dispatchEvent (int remoteOid, DObject target, DEvent event)
    {
        try {
            // apply the event to the object
            boolean notify = event.applyToObject(target);

            // if this is an object destroyed event, we need to remove the object from our table
            if (event instanceof ObjectDestroyedEvent) {
//                 Log.info("Pitching destroyed object [oid=" + remoteOid +
//                          ", class=" + StringUtil.shortClassName(target) + "].");
                _ocache.remove(remoteOid);
            }

            // have the object pass this event on to its listeners
            if (notify) {
                target.notifyListeners(event);
            }

        } catch (Exception e) {
            log.warning("Failure processing event", "event", event, "target", target, e);
        }
    }
187958
@AllowConcurrentEvents
    @Subscribe
    public void handleSubscriptionEvents(final BusInternalEvent event) {
        final List<CompletionUserRequestNotifier> runningWaiters = new ArrayList<CompletionUserRequestNotifier>();
        synchronized (activeWaiters) {
            runningWaiters.addAll(activeWaiters);
        }
        if (runningWaiters.size() == 0) {
            return;
        }
        for (final CompletionUserRequestNotifier cur : runningWaiters) {
            cur.onBusEvent(event);
        }
    }
750080
public void eventReceived (DEvent event)
    {
        if (event instanceof InvocationResponseEvent) {
            InvocationResponseEvent ire = (InvocationResponseEvent)event;
            handleInvocationResponse(ire.getRequestId(), ire.getMethodId(), ire.getArgs());

        } else if (event instanceof InvocationNotificationEvent) {
            InvocationNotificationEvent ine = (InvocationNotificationEvent)event;
            handleInvocationNotification(ine.getReceiverId(), ine.getMethodId(), ine.getArgs());

        } else if (event instanceof MessageEvent) {
            MessageEvent mevt = (MessageEvent)event;
            if (mevt.getName().equals(ClientObject.CLOBJ_CHANGED)) {
                handleClientObjectChanged(((Integer)mevt.getArgs()[0]).intValue());
            }
        }
    }
121084
public void notifyProxies (DEvent event)
    {
        if (_subs == null || event.isPrivate()) {
            return;
        }

        for (Object sub : _subs) {
            try {
                if (sub != null && sub instanceof ProxySubscriber) {
                    ((ProxySubscriber)sub).eventReceived(event);
                }
            } catch (Exception e) {
                log.warning("Proxy choked during notification", "sub", sub, "event", event, e);
            }
        }
    }
933667
public function dispatch($event): void
    {
        Assertion::isObject($event, 'An event should be an object');

        $eventName = get_class($event);
        $eventSubscribers = array_merge(
            $this->subscribedToAllEvents,
            $this->subscribers[$eventName] ?? []
        );

        foreach ($eventSubscribers as $eventSubscriber) {
            $eventSubscriber($event);
        }
    }
929713
public <T> void handleEvent(final T event) throws EventException {
		final Class<?> type = event.getClass();
		if (!this.cachedListeners.containsKey(event.getClass())) {
			this.cachedListeners.put(type, new LinkedList<ListenerInstancePair<?>>());
			for (final ListenerInstancePair<?> listener : this.listeners) {
				final Type observableType = GenericsUtil.getEntityGenericType(listener.listener.getClass(), 0, Listener.class);
				final Class<?> observable = GenericsUtil.guessClazz(observableType);
				if (observable.isAssignableFrom(type)) {
					this.cachedListeners.get(type).add(listener);
				}
			}
		}
		@SuppressWarnings("unchecked")
		final List<ListenerInstancePair<T>> resolvedListeners = List.class.cast(this.cachedListeners.get(event.getClass()));
		for (final ListenerInstancePair<T> listener : resolvedListeners) {
			listener.handleEvent(event, null);
		}
	}
1212435
protected void enqueueEvent(Object event, EventHandler handler) {
    eventsToDispatch.get().offer(new EventWithHandler(event, handler));
  }
677399
function dispatchEvent (event, data) {
    if (hasDOM()) {
      eventEmitter.dispatchEvent(new CustomEvent(event, data));
    } else if (hasEventEmitter()) {
      eventEmitter.emit(event, data);
    }
  }
54137
@Override
  public synchronized void handleEvent(final Event event) {
    if (event.getType() == EventType.JOB_STARTED) {
      this.value = this.value + 1;
    } else if (event.getType() == EventType.JOB_FINISHED) {
      this.value = this.value - 1;
    }
  }
501165
private void onMessageSent(MessageSentEvent event) {
        handler.post(() -> listener.onMessageSent(event));
        log("Event published " + event.toString());
    }
1359585
public <E extends Event> void publish(E event) {
        if (!eventListenerMap.isEmpty()) {
            EventListener<E> eventListener = getEventListener(event);
            if (eventListener != null) {
                eventListener.on(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);
        }
    }
675969
protected void dispatchEvent (DEvent event)
    {
//         Log.info("Dispatching event: " + evt);

        // look up the object on which we're dispatching this event
        int remoteOid = event.getTargetOid();
        DObject target = _ocache.get(remoteOid);
        if (target == null) {
            if (!_dead.containsKey(remoteOid)) {
                log.warning("Unable to dispatch event on non-proxied object " + event + ".");
            }
            return;
        }

        // because we might be acting as a proxy for a remote server, we may need to fiddle with
        // this event before we dispatch it
        _client.convertFromRemote(target, event);

        // if this is a compound event, we need to process its contained events in order
        if (event instanceof CompoundEvent) {
            // notify our proxy subscribers in one fell swoop
            target.notifyProxies(event);

            // now break the event up and dispatch each event to listeners individually
            List<DEvent> events = ((CompoundEvent)event).getEvents();
            int ecount = events.size();
            for (int ii = 0; ii < ecount; ii++) {
                dispatchEvent(remoteOid, target, events.get(ii));
            }

        } else {
            // forward to any proxies (or not if we're dispatching part of a compound event)
            target.notifyProxies(event);

            // and dispatch the event to regular listeners
            dispatchEvent(remoteOid, target, event);
        }
    }
412202
def _dispatch_event(self, event: LutronEvent, params: Dict):
    """"""
    for handler, context in self._subscribers:
      handler(self, context, event, params)