Notifies listeners of a new message
767973
def _notify_listeners(self, sender, message):
        
        uid = message['uid']
        msg_topic = message['topic']


        self._ack(sender, uid, 'fire')

        all_listeners = set()
        for lst_topic, listeners in self.__listeners.items():
            if fnmatch.fnmatch(msg_topic, lst_topic):
                all_listeners.update(listeners)

        self._ack(sender, uid, 'notice', 'ok' if all_listeners else 'none')

        try:
            results = []
            for listener in all_listeners:
                result = listener.handle_message(sender,
                                                 message['topic'],
                                                 message['content'])
                if result:
                    results.append(result)

            self._ack(sender, uid, 'send', json.dumps(results))
        except:
            self._ack(sender, uid, 'send', "Error")
852206
def _notify(p, **data):
    """"""
    message = data.get("message")
    if not message and not sys.stdin.isatty():
        message = click.get_text_stream("stdin").read()
    data["message"] = message

    data = clean_data(data)

    ctx = click.get_current_context()
    if ctx.obj.get("env_prefix"):
        data["env_prefix"] = ctx.obj["env_prefix"]

    rsp = p.notify(**data)
    rsp.raise_on_errors()
    click.secho(f"Succesfully sent a notification to {p.name}!", fg="green")
701129
void onReceive(int register, byte[] message) {
        I2CEvent evt = new I2CEvent(this, register, message);
        I2CListener listener = callbacks.remove(register);
        if (listener == null) {
            for (I2CListener subscriber : subscribers) {
                subscriber.onReceive(evt);
            }
        } else {
            listener.onReceive(evt);
        }
    }
1247733
def notify(self, msgtype, method, params):
        """"""
        self.dispatch.call(method, params)
777997
@Override
    public void onReceive(Object message) {
        if (message instanceof NewMessage) {
            NewMessage newMessage = (NewMessage) message;
            onNewMessage(newMessage.getPeer(), newMessage.getSender(), newMessage.getSortDate(),
                    newMessage.getContentDescription(), newMessage.getHasCurrentUserMention(),
                    newMessage.getUnreadMessagesCount(), newMessage.getUnreadDialogsCount());
        } else if (message instanceof MessagesRead) {
            MessagesRead read = (MessagesRead) message;
            onMessagesRead(read.getPeer(), read.getFromDate());
        } else if (message instanceof PauseNotifications) {
            onNotificationsPaused();
        } else if (message instanceof ResumeNotifications) {
            onNotificationsResumed();
        } else {
            super.onReceive(message);
        }
    }
1337077
protected void notifyListeners() {
		Iterator it = listeners.iterator();
		while (it.hasNext()) {
			((ComponentListener) it.next()).componentActivated(this);
		}
	}
381538
function createListener (msg) {
  function listener (err) {
    if (msg.__onFinished === listener) msg.__onFinished = null
    if (!listener.queue) return

    var queue = listener.queue
    listener.queue = null

    for (var i = 0; i < queue.length; i++) {
      queue[i](err, msg)
    }
  }

  listener.queue = []

  return listener
}
149386
private void requestNotification() {
        AndPermission.with(this)
            .notification()
            .permission()
            .rationale(new NotifyRationale())
            .onGranted(new Action<Void>() {
                @Override
                public void onAction(Void data) {
                    toast(R.string.successfully);
                }
            })
            .onDenied(new Action<Void>() {
                @Override
                public void onAction(Void data) {
                    toast(R.string.failure);
                }
            })
            .start();
    }
1155058
def notify_message(self, message, level="info", clear_if_dupl=True,
                       clear_in=CLEAR_NOTIF_BAR_MESSAGE_IN):
        
        with self.notifications_lock:
            if clear_if_dupl and message in self.message_widget_dict.keys():
                logger.debug("notification %r is already displayed", message)
                return
            logger.debug("display notification %r", message)
            widget = urwid.AttrMap(urwid.Text(message), "notif_{}".format(level))
        return self.notify_widget(widget, message=message, clear_in=clear_in)
1326034
def notify(self, *args, **kwargs):
        ''''''
        for handler in tuple(self.handlers):
            handler(*args, **kwargs)
1332059
private void notifyListenersAfterRequest(ModbusRequest req) {
        synchronized (listeners) {
            for (AbstractSerialTransportListener listener : listeners) {
                listener.afterRequestRead(commPort, req);
            }
        }
    }
272239
def notify_peer_message(self, message, sender_id):
        """"""
        payload = message.SerializeToString()
        self._notify(
            "consensus_notifier_notify_peer_message",
            payload,
            len(payload),
            sender_id,
            len(sender_id))
69709
function notify() {
    var args = arguments
    handlers.forEach(function(f){ f.apply(null, args) }) }
1332904
private void doNotifyListeners(R oldValue, R newValue) {
        List<ValueChangeListener<R>> listenersCopy = new ArrayList<ValueChangeListener<R>>(listeners);
        notifyingListeners = true;
        for (ValueChangeListener<R> listener : listenersCopy) {
            listener.valueChanged(this, oldValue, newValue);
        }
        notifyingListeners = false;
    }
71726
def received_message(self, address, data):
        """"""
        self.value_cache.set(address, data)
        if self.notify:
            self.notify(address, data)

        try:
            listeners = self.address_listeners[address]
        except KeyError:
            listeners = []

        for listener in listeners:
            listener(address, data)
1291772
private void notifyListenersAfterWrite(ModbusMessage msg) {
        synchronized (listeners) {
            for (AbstractSerialTransportListener listener : listeners) {
                listener.afterMessageWrite(commPort, msg);
            }
        }
    }
430309
private void notifyListenersAfterResponse(ModbusResponse res) {
        synchronized (listeners) {
            for (AbstractSerialTransportListener listener : listeners) {
                listener.afterResponseRead(commPort, res);
            }
        }
    }