SECTION: MESSAGE OBSERVER
485629
@Override
	protected void onReceived(Request request, Response response)
	{
		activeRequestsCounter.inc();
		START_TIMES_BY_CORRELATION_ID.put(request.getCorrelationId(), System.nanoTime());
	}
440213
def Message(message, title='FontParts', informativeText=""):
    
    return dispatcher["Message"](message=message, title=title,
                                 informativeText=informativeText)
1045150
protected void notifyChatterObservers ()
    {
        _chatterObservers.apply(new ObserverList.ObserverOp<ChatterObserver>() {
            public boolean apply (ChatterObserver observer) {
                observer.chattersUpdated(_chatters.listIterator());
                return true;
            }
        });
    }
961559
async function handleMessagePing(state, msgObj) {

    /**
     * when there are no listener, we do nothing
     */
    if (!state.messagesCallback) return;

    let messages;
    if (!msgObj) {
        // get all
        messages = await getAllMessages(state.channelName, state.paths);
    } else {
        // get single message
        messages = [
            getSingleMessage(state.channelName, msgObj, state.paths)
        ];
    }

    const useMessages = messages
        .filter(msgObj => _filterMessage(msgObj, state))
        .sort((msgObjA, msgObjB) => msgObjA.time - msgObjB.time); // sort by time


    // if no listener or message, so not do anything
    if (!useMessages.length || !state.messagesCallback) return;

    // read contents
    await Promise.all(
        useMessages
        .map(
            msgObj => readMessage(msgObj).then(content => msgObj.content = content)
        )
    );

    useMessages.forEach(msgObj => {
        state.emittedMessagesIds.add(msgObj.token);

        if (state.messagesCallback) {
            // emit to subscribers
            state.messagesCallback(msgObj.content.data);
        }
    });
}
199201
protected void addMessage(String message)
    {
        messages.add(message);
        messageCount++;
        if (messageCount > messagesQueueMax)
        {
            messages.remove();
            messageCount--;
        }
    }
695306
private void handlePeerMessage(PeerMessage message) {
		// Ignore our own updates
		Peer peer = PeerUtils.fromMessage(message, Status.ACTIVE);
		if(peer.getId().equals(self)) {
			return;
		}

		// Add or update the peer
		synchronized(this) {
			if(!peers.containsKey(peer.getId())) {
				add(peer);
			}
			else {
				update(peer);
			}
		}
	}
958713
function _onInboxMessage (sender, _, msgBuffer) {
    let message = JSON.parse(msgBuffer)
    masterBroker.setIP(message.toAddress)

    switch (message.type) {
      case 'voteRequest':
        debug(`sending vote to ${node.name === message.from ? 'myself' : message.from}`)
        _inbox.send([sender, _, JSON.stringify({
          id: _advertiseId || node.id,
          name: node.name,
          endpoints: masterBroker.endpoints,
          isMaster: masterBroker.isMaster,
          candidate: !_advertiseId
        })])
        break
      case 'masterRequest':
        let connectedMaster = node.master
        if (connectedMaster) {
          debug(`sending master coordinates to ${message.from}`)
          _inbox.send([sender, _, JSON.stringify(connectedMaster)])
        } else {
          debug(`unable to send master coordinates to ${message.from}`)
          _inbox.send([sender, _, JSON.stringify(false)])
        }
        break
      case 'masterElected':
        _inbox.send([sender, _, ''])
        debug(`received notice of master election: ${message.data.name}`)
        resolver.emit('newmaster', message.data)
    }
  }
231587
def on_messages(self, msg_list):
        
        self.stats.on_pack_recv(len(msg_list))

        for msg in msg_list:
            if self.state == OPEN:
                self.conn.on_message(msg)
806849
def handle_message(self, msg):
        
        if msg.msg_id not in self.msg_types:
            self.report_message_type(msg)
            self.msg_types.add(msg.msg_id)

        self.tc.message('inspection', typeId=msg.msg_id, message=msg.msg,
                        file=os.path.relpath(msg.abspath).replace('\\', '/'),
                        line=str(msg.line),
                        SEVERITY=TC_SEVERITY.get(msg.category))
251111
public void setStatusBarMessage(final String message)
    {
        // Guaranteed to return a non-null array
        Object[] listeners = listenerList.getListenerList();
        // Process the listeners last to first, notifying
        // those that are interested in this event
        for (int i = listeners.length-2; i>=0; i-=2) {
            if (listeners[i]==StatusMessageListener.class) 
            {
                ((StatusMessageListener)listeners[i+1]).statusMessageReceived(message);
            }          
        }        
    }
271952
def notify(msg)

      waiters, observers = @services.select { |n, s|
        s.respond_to?(:on_msg)
      }.sort_by { |n, s|
        n
      }.partition { |n, s|
        s.respond_to?(:wait_for)
      }

      (observers + waiters).each { |n, s| s.on_msg(msg) }
    end
606323
public synchronized void notifyObservers(Object arg) {
        for (int i = 0; i < observers.size(); i++) {
            observers.elementAt(i).update(this, arg);
        }
    }
1317120
def on_message(self, client, userdata, msg):
        '''
        
        '''
        if msg.topic == 'serial_device/refresh_comports':
            self.refresh_comports()
            return

        match = CRE_MANAGER.match(msg.topic)
        if match is None:
            logger.debug('Topic NOT matched: `%s`', msg.topic)
        else:
            logger.debug('Topic matched: `%s`', msg.topic)
            # Message topic matches command.  Handle request.
            command = match.group('command')
            port = match.group('port')

            #     serial_device/<port>/send   # Bytes to send
            if command == 'send':
                self._serial_send(port, msg.payload)
            elif command == 'connect':
                # serial_device/<port>/connect  # Request connection
                try:
                    request = json.loads(msg.payload)
                except ValueError as exception:
                    logger.error('Error decoding "%s (%s)" request: %s',
                                 command, port, exception)
                    return
                self._serial_connect(port, request)
            elif command == 'close':
                self._serial_close(port)
828801
public void setMessage(CharSequence message){
        if(mConstruct != null && !mConstruct.getDesign().isMaterial()){
            TextView msgView = (TextView) getDialog().findViewById(R.id.message);
            msgView.setText(message);
        }else{
            if(mMessage != null){
                mMessage.setText(message);
            }
        }
    }
118755
function(_target,_message){
                var _from = _message.from;
                while(!!_target){
                    if (_target._$getPath()!=_from){
                        _doSendMessage(_target,_message);
                    }
                    _target = _target._$getParent();
                }
            }
732662
def on_message(self, started_waiting):
        
        watcher = self.settings.watcher
        if started_waiting:
            watcher.start_waiting()
        else:
            watcher.done_waiting()
887414
@Override
    public void doMessageReceivedListeners(final Object message) {
        runManagementTask(new Runnable() {
            @Override
            public void run() {
                try {
                    List<SessionManagementListener> sessionListeners = getManagementListeners();
                    for (final SessionManagementListener listener : sessionListeners) {
                        listener.doMessageReceived(SessionManagementBeanImpl.this, message);
                    }

                    markChanged();
                } catch (Exception ex) {
                    logger.warn("Error during doMessageReceived session listener notifications:", ex);
                }
            }
        });
    }