Handler for memory observation events.
@param {*} subject Anything.
@param {string} topic Event name.
@param {[type]} json JSON string of GC data.
17113
function handleMemoryEvent(subject, topic, json) {
  if (topic != 'garbage-collection-statistics') {
    return;
  }

  // Broadcast the event to all active workers.
  // We avoid parsing it here and let the pages handle it.
  for each (injectedTab in injectedTabs) {
    injectedTab.queueDebuggerRecord(['gc', json]);
  }
}
1196952
function (handle) {
        if (handle) {
            var topic = handle.topic, list = listeners[topic];
            if (list) {
                for (var i = list.length - 1; i >= 0; i--) {
                    if (list[i] === handle) {
                        list.splice(i, 1);
                    }
                }
                if (!list.length) {
                    delete listeners[topic];
                }
            }
        }
    }
47745
private void postRoutedNotificationListenerRegistrationEvent(String operation, NotificationTargetInformation nti) {
        Map<String, Object> props = createListenerRegistrationEvent(operation, nti);
        safePostEvent(new Event(REGISTER_JMX_NOTIFICATION_LISTENER_TOPIC, props));
    }
499210
public void checkEventTopicSyntax(String topic)
    throws InvalidTopicSyntaxException
  {
    checkTopicNotNull(topic);
		    
    if (topic.indexOf(MatchSpace.SUBTOPIC_MQSI_MATCHONE_CHAR) > -1 || 
      topic.indexOf(MatchSpace.SUBTOPIC_MQSI_MATCHMANY_CHAR) > -1)
      throw new InvalidTopicSyntaxException(
         NLS.format(
           "INVALID_TOPIC_ERROR_CWSIH0006",
           new Object[] { topic }));
  }
1324400
function(transport, message, info) {
        var e = message[0].replace('/', '');

        var data = null;
        if (message[1]) {
            try {
                data = JSON.parse(message[1]);
            } catch (e) {
                logger.warn('OSC messages should be JSON');
            }
        }

        transport.emit(e, data);
    }
1059664
private void processChildEvent(WatchedEvent event) throws Exception {
        HashMap<String, JSONObject> cacheCopy = new HashMap<String, JSONObject>(m_publicCache.get());
        ByteArrayCallback cb = new ByteArrayCallback();
        m_zk.getData(event.getPath(), m_childWatch, cb, null);
        try {
            byte payload[] = cb.get();
            JSONObject jsObj = new JSONObject(new String(payload, "UTF-8"));
            cacheCopy.put(cb.getPath(), jsObj);
        } catch (KeeperException.NoNodeException e) {
            cacheCopy.remove(event.getPath());
        }
        m_publicCache.set(ImmutableMap.copyOf(cacheCopy));
        if (m_cb != null) {
            m_cb.run(m_publicCache.get());
        }
    }
201098
private void onParticipantIsTyping(ParticipantTypingEvent event) {
        handler.post(() -> listener.onParticipantIsTyping(event));
        log("Event published " + event.toString());
    }
816743
def process_event(self, name, subject, data):
        
        method_mapping = Registry.get_event(name)
        if not method_mapping:
            log.info('@{}.process_event no subscriber for event `{}`'
                     .format(self.__class__.__name__, name))
            return
        for event, methods in method_mapping.items():
            event_instance = event(subject, data)
            log.info('@{}.process_event `{}` for subject `{}`'.format(
                self.__class__.__name__,
                event_instance.__class__.__name__,
                subject
            ))
            for method in methods:
                with self._context_manager:
                    log.info('>> Calling subscriber `{}`'
                             .format(method.__name__))
                    method(event_instance)
515781
@Async
    public void send(String topic, String content) {
        try {
            if (!StringUtils.isBlank(content)) {
                log.debug("Sending kafka event with data {} to topic {}", content, topic);
                template.send(topic, content);
            }
        } catch (Exception e) {
            log.error("Error send timeline event", e);
            throw e;
        }
    }
371678
private void updateReadHistory(JmxReadRequest pJmxReq, JSONObject pJson, long pTimestamp)  {
        ObjectName name = pJmxReq.getObjectName();
        if (name.isPattern()) {
            // We have a pattern and hence a value structure
            // of bean -> attribute_key -> attribute_value
            Map<String,Object> values = (Map<String, Object>) pJson.get(KEY_VALUE);
            // Can be null if used with path and no single match occurred
            if (values != null) {
                JSONObject history = updateHistoryForPatternRead(pJmxReq, pTimestamp, values);
                if (history.size() > 0) {
                    pJson.put(KEY_HISTORY,history);
                }
            }
        } else if (pJmxReq.isMultiAttributeMode() || !pJmxReq.hasAttribute()) {
            // Multiple attributes, but a single bean.
            // Value has the following structure:
            // attribute_key -> attribute_value
            JSONObject history = addMultipleAttributeValues(
                    pJmxReq,
                    ((Map<String, Object>) pJson.get(KEY_VALUE)),
                    pJmxReq.getObjectNameAsString(),
                    pTimestamp);
            if (history.size() > 0) {
                pJson.put(KEY_HISTORY,history);
            }
        } else {
            // Single attribute, single bean. Value is the attribute_value
            // itself.
            addAttributeFromSingleValue(pJson,
                                        new HistoryKey(pJmxReq), KEY_HISTORY,
                                        pJson.get(KEY_VALUE),
                                        pTimestamp);
        }
    }
204805
protected void setSubject(Subject subject) {
        Subject currentSubject = this.subject;
        if (!(currentSubject == null && subject == null)) {
            this.subject = subject;
            if (currentThread() == ioThread) {
                notifySubjectChanged(subject);
            }
            else {
                final Subject changedSubject = subject;
                ioExecutor.execute(new Runnable() {
                    @Override
                    public void run() {
                        notifySubjectChanged(changedSubject);
                    }
                });
            }
        }
    }
421180
function Subject() {
    __super__.call(this, subscribe);
    this.isDisposed = false,
    this.isStopped = false,
    this.observers = [];
    this.hasError = false;
  }
106704
function onServerMessage(data)
    {
        if(data.ev)
        {
            scope.dispatchEvent("onServerMessage",data);
            scope.dispatchEvent(data.ev,data);
        }
    }
647275
function expose(subject, callback) {
  var name;

  if (!this.active) {
    return this;
  }

  if (typeof subject === 'string') {
    this.localComponents[subject] = true;
    this.exposed[subject] = callback;
  } else if (typeof subject === 'object') {
    for (name in subject) {
      if (subject.hasOwnProperty(name)) {
        this.localComponents[name] = true;
        this.exposed[name] = subject[name];
      }
    }
  }

  return this;
}
1344103
def handle_subscribe(client, data)
      topic = @engine.subscribe_client_to_topic client, data[0]

      trigger(:subscribe, client, topic.uri)
    end
763816
function( topic, data ){

            if ( !this._topics ){
                // nothing subscribed
                return this;
            }

            var listeners = this._topics[ topic ]
                ,l = listeners && listeners.length
                ,handler
                ,e
                ,scratch = Physics.scratchpad()
                ;

            if ( !l ){
                return scratch.done(this);
            }

            e = scratch.event();
            // event data
            e.topic = topic;
            e.handler = handler;

            // reverse iterate so priorities work out correctly
            while ( l-- ){

                handler = listeners[ l ];
                handler( data, e );

                // if _one_ flag is set, the unsubscribe
                if ( handler._one_ ){
                    listeners.splice( l, 1 );
                }
            }

            return scratch.done(this);
        }
19045
def schema_is_registered_for_subject(self, subject, schema):
        
        data = json.dumps({'schema': json.dumps(schema)})
        res = requests.post(self._url('/subjects/{}', subject), data=data, headers=HEADERS)
        if res.status_code == 404:
            return False
        raise_if_failed(res)
        return True