Notify connected clients of an update to a bin
492738
function (bin, data, statsRequest) {
    var id = bin.id,
        delayTrigger = 500;

    if (!pending[id]) {
      pending[id] = {};
    }

    pending[id].bin = bin;
    pending[id][data.panelId] = utils.process(data, bin.settings);

    // Clear the previous ping
    clearTimeout(pending[id].timer);

    // NOTE: this will only fire once per jsbin session -
    // not for every panel sent - because we clear the timer
    pending[id].timer = setTimeout(function () {
      var session = utils.sessionForBin(bin),
          data = null,
          ping = pending[id];


      if (!ping) { return; }

      // Javascript and HTML cause reloads. CSS is injected.
      data = ping.javascript || ping.html || ping.css || (statsRequest ? {} : false);

      // Forget this ping, it's done with now
      delete pending[id];

      if (!data) { return; }
      if (!session) { return; }

      // Send the update to all connected sessions in original and raw flavours
      session.res.forEach(function (res) {
        var raw = data.raw || data.content;
        if (!res.req.stats) {
          res.write(utils.makeEvent(data.panelId, raw));
          res.write(utils.makeEvent(data.panelId + ':processed', data.content));
        }
        res.write(utils.makeEvent('stats', { connections: session.res.filter(function (res) {
          return !res.req.stats;
        }).length }));
        if (res.ajax && !statsRequest) {
          res.end(); // lets older browsers finish their xhr request
          res.req.emit('close');
        }
      });

    }, delayTrigger);
  }
1213700
private void updateOtherClientConnected() throws IOException
    {
        final byte cid = in.readByte();
        final String cname = readString();
        for (final ConnectionListener listener : listeners)
        {
            listener.notifyClientConnected(Byte.valueOf(cid), cname);
        }
    }
1031371
function update() {
	connection = new Connection(room)
	// set our funcitonal code on the ready event, so we are sure that the socket has been created and is connected to the server
	connection.on('ready', _ => {
		connection.on('snapshot-event', event => {
			// get every listener including bots and lurkers
			userList = event.data.listing.sort()
			render(userList)
			connection.close()
		})
	})
}
1074387
def update(self, client):
        """"""
        update_cmd = "{sudo} '{refresh};{update}'".format(
            sudo=self.get_sudo_exec_wrapper(),
            refresh=self.get_refresh_repo_cmd(),
            update=self.get_update_cmd()
        )

        out = ''
        try:
            out = ipa_utils.execute_ssh_command(
                client,
                update_cmd
            )
        except Exception as error:
            raise IpaDistroException(
                'An error occurred updating instance: %s' % error
            )
        return out
69709
function notify() {
    var args = arguments
    handlers.forEach(function(f){ f.apply(null, args) }) }
331058
private void notifyInactive(Peer peer) {
		for(Listener listener : new HashSet<>(listeners)) {
			listener.onInactive(peer);
		}
	}
101957
def my_on_connect(client):
    
    client.send('You connected from %s\n' % client.addrport())
    if CLIENTS:
        client.send('Also connected are:\n')
        for neighbor in CLIENTS:
            client.send('%s\n' % neighbor.addrport())
    else:
        client.send('Sadly, you are alone.\n')
    CLIENTS.append(client)
159958
def notify(self, reading):
        """"""
        # copy list before iterating in case new observers arrive
        for o in list(self._observers):
            o.update(self, reading)
376659
private void sendHubHeartbeats()
  {
    RackHeartbeat rack = _rack;
    
    UpdateRackHeartbeat updateRack = rack.getUpdate();
    UpdatePodSystem updatePod = getUpdatePodSystem();
    
    long now = CurrentTime.currentTime();
    
    if (! isJoinComplete()) {
      updatePod = null;
    }

    // send hub update to all servers in the rack
    for (ServerHeartbeat rackServer : _rack.getServers()) {
      if (rackServer == null || rackServer == _serverSelf) {
        continue;
      }

      ServerTarget target = createTargetServer(rackServer);
      
      target.hubHeartbeat(getServerSelf().getUpdate(),
                             updateRack,
                             updatePod,
                             now);
    }
  }
1271101
public void notifyClients()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "notifyClients");

        // We'll only fire events if eventing is enabled or depths are being monitored
        // (510343)
        if (isThresholdNotificationRequired())
        {
            long totalItems = getTotalMsgCount();
            synchronized (this)
            {
                if (wlmRemoved && ((_destLowMsgs == -1) || (totalItems <= _destLowMsgs)))
                {
                    wlmRemoved = false;
                    // Fire event
                    fireDepthThresholdReachedEvent(getControlAdapter(),
                                                   false,
                                                   totalItems, _destLowMsgs); // Reached low
                }
                else if (!wlmRemoved
                         && (_destHighMsgs != -1)
                         && (_destLowMsgs != -1)
                         && (totalItems >= _destHighMsgs))
                {
                    wlmRemoved = true;
                    // Fire event
                    fireDepthThresholdReachedEvent(getControlAdapter(),
                                                   true,
                                                   totalItems, _destHighMsgs); // Reached High
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "notifyClients");
    }
533003
def refresh(self, updated_self):

		'''
		
		'''

		logger.debug('refreshing binary attributes')
		self.mimetype = updated_self.binary.mimetype
		self.data = updated_self.binary.data
269642
def notify(self, new_jobs_count):
        

        if not self.use_notify():
            return

        # Not really useful to send more than 100 notifs (to be configured)
        count = min(new_jobs_count, 100)

        notify_key = redis_key("notify", self)

        context.connections.redis.lpush(notify_key, *([1] * count))
        context.connections.redis.expire(notify_key, max(1, int(context.get_current_config()["max_latency"] * 2)))
5673
def update_callback(self, handle, events):
        """"""
        if self._poll is None:
            raise RuntimeError('poll instance is closed')
        if not has_callback(self, handle):
            raise ValueError('no such callback')
        if events & ~(READABLE|WRITABLE):
            raise ValueError('illegal event mask: {}'.format(events))
        if handle.extra == events:
            return
        if handle.extra & READABLE:
            self._readers -= 1
        if handle.extra & WRITABLE:
            self._writers -= 1
        if events & READABLE:
            self._readers += 1
        if events & WRITABLE:
            self._writers += 1
        handle.extra = events
        self._sync()
811818
function notifyLightClientsAboutStableJoints(from_mci, to_mci) {
	db.query(
		"SELECT peer FROM units JOIN unit_authors USING(unit) JOIN watched_light_addresses USING(address) \n\
		WHERE main_chain_index>? AND main_chain_index<=? \n\
		UNION \n\
		SELECT peer FROM units JOIN outputs USING(unit) JOIN watched_light_addresses USING(address) \n\
		WHERE main_chain_index>? AND main_chain_index<=? \n\
		UNION \n\
		SELECT peer FROM units JOIN watched_light_units USING(unit) \n\
		WHERE main_chain_index>? AND main_chain_index<=?",
		[from_mci, to_mci, from_mci, to_mci, from_mci, to_mci],
		function (rows) {
			rows.forEach(function (row) {
				let ws = getPeerWebSocket(row.peer);
				if (ws && ws.readyState === ws.OPEN)
					sendJustsaying(ws, 'light/have_updates');
			});
			db.query("DELETE FROM watched_light_units \n\
				WHERE unit IN (SELECT unit FROM units WHERE main_chain_index>? AND main_chain_index<=?)", [from_mci, to_mci], function () {

			});
		}
	);
}
473042
def routers_updated(self, context, routers, operation=None, data=None,
                        shuffle_agents=False):
        
        if routers:
            self._notification(context, 'routers_updated', routers, operation,
                               shuffle_agents)
1113387
def notify(message, message_opts = {})
      if _client?
        return unless enabled?
      else
        return unless active?
      end

      @detected.available.each do |notifier|
        notifier.notify(message, message_opts.dup)
      end
    end
1086149
protected void notifyToHandlers(ApiZone zone, ApiBuddyImpl buddy) {
        for(ServerHandlerClass handler : handlers) {
            notifyToHandler(handler, zone, buddy);
        }
    }