Subscribes to status updates of the requested object.

    DEPRECATED

    The handler will be invoked when the controller sends a notification
    regarding changed state. The user can then further query the object for the
    state itself.
340602
def subscribe(self, obj, handler):
    """"""
    if not isinstance(obj, LutronEntity):
      raise InvalidSubscription("Subscription target not a LutronEntity")
    _LOGGER.warning("DEPRECATED: Subscribing via Lutron.subscribe is obsolete. "
                    "Please use LutronEntity.subscribe")
    if obj not in self._legacy_subscribers:
      self._legacy_subscribers[obj] = handler
      obj.subscribe(self._dispatch_legacy_subscriber, None)
539536
protected void notifyRequestListeners(RequestNotifierAction action, HttpServletRequest req, HttpServletResponse resp) throws IOException {
		// notify any listeners that the config has been updated
		IServiceReference[] refs = null;
		try {
			refs = getPlatformServices().getServiceReferences(IRequestListener.class.getName(),  "(name="+getName()+")"); //$NON-NLS-1$ //$NON-NLS-2$
		} catch (PlatformServicesException e) {
			if (log.isLoggable(Level.SEVERE)) {
				log.log(Level.SEVERE, e.getMessage(), e);
			}
		}
		if (refs != null) {
			for (IServiceReference ref : refs) {
				IRequestListener listener = (IRequestListener)getPlatformServices().getService(ref);
				try {
					if (action == RequestNotifierAction.start) {
						listener.startRequest(req, resp);
					} else {
						listener.endRequest(req, resp);
					}
				} finally {
					getPlatformServices().ungetService(ref);
				}
			}
		}
	}
853783
function(object, object_id, callback) {
    if (typeof object_id === 'function') callback = object_id;
    request.post(this._endpoint, {
        form: this.subscribeParams(object, object_id)
      }, function(error, response, body) {
        if (!error && response.statusCode == 200) {
          var res = JSON.parse(body);
          callback(null, res.data);
        } else {
          callback(error, null);
        }
      }
    );
  }
1102179
public void subscribe (DObjectManager omgr)
    {
        if (_active) {
            log.warning("Active safesub asked to resubscribe " + this + ".", new Exception());
            return;
        }

        // note that we are now again in the "wishing to be subscribed" state
        _active = true;

        // make sure we dont have an object reference (which should be
        // logically impossible)
        if (_object != null) {
            log.warning("Incroyable! A safesub has an object and was " +
                        "non-active!? " + this + ".", new Exception());
            // make do in the face of insanity
            _subscriber.objectAvailable(_object);
            return;
        }

        if (_pending) {
            // we were previously asked to subscribe, then they asked to
            // unsubscribe and now they've asked to subscribe again, all
            // before the original subscription even completed; we need do
            // nothing here except as the original subscription request
            // will eventually come through and all will be well
            return;
        }

        // we're not pending and we just became active, that means we need
        // to request to subscribe to our object
        _pending = true;
        omgr.subscribeToObject(_oid, this);
    }
293220
public void execute() {
        state = State.Running;
        for (Subscription sub : subscriptions) {
           sub.publish(this, message);
        }
        state = State.Finished;
        // This part is necessary to support the feature of publishing a DeadMessage or FilteredMessage
        // in case that the original message has not made it to any listener.
        // This happens if subscriptions are empty (due to GC of weak listeners or explicit desubscription)
        // or if configured filters do not let a message pass. The flag is set by the dispatchers.
        // META: This seems to be a suboptimal design
        if (!dispatched) {
            if (!isFilteredMessage() && !isDeadMessage()) {
                runtime.getProvider().publish(new FilteredMessage(message));
            } else if (!isDeadMessage()) {
                runtime.getProvider().publish(new DeadMessage(message));
            }

        }
    }
265178
public void updateState() {
        // Applying zoom patch (needed in case if image size is changed)
        stateController.applyZoomPatch(state);
        stateController.applyZoomPatch(prevState);
        stateController.applyZoomPatch(stateStart);
        stateController.applyZoomPatch(stateEnd);
        exitController.applyZoomPatch();

        boolean reset = stateController.updateState(state);
        if (reset) {
            notifyStateReset();
        } else {
            notifyStateUpdated();
        }
    }
937104
async def notify(self, *args):
        
        from .filters import check_filters, FilterNotPassed

        results = []

        data = {}
        ctx_data.set(data)

        if self.middleware_key:
            try:
                await self.dispatcher.middleware.trigger(f"pre_process_{self.middleware_key}", args + (data,))
            except CancelHandler:  # Allow to cancel current event
                return results

        try:
            for handler_obj in self.handlers:
                try:
                    data.update(await check_filters(handler_obj.filters, args))
                except FilterNotPassed:
                    continue
                else:
                    ctx_token = current_handler.set(handler_obj.handler)
                    try:
                        if self.middleware_key:
                            await self.dispatcher.middleware.trigger(f"process_{self.middleware_key}", args + (data,))
                        partial_data = _check_spec(handler_obj.spec, data)
                        response = await handler_obj.handler(*args, **partial_data)
                        if response is not None:
                            results.append(response)
                        if self.once:
                            break
                    except SkipHandler:
                        continue
                    except CancelHandler:
                        break
                    finally:
                        current_handler.reset(ctx_token)
        finally:
            if self.middleware_key:
                await self.dispatcher.middleware.trigger(f"post_process_{self.middleware_key}",
                                                         args + (results, data,))

        return results
492030
function reloadState(model, notify) {
    return function reload() {
        let { pathname, histories } = model,
            method = actionTypes.replace;

        // 更新监听
        return notify({
            pathname, method, histories, length: histories.length
        });
    };
}
1060597
function(type, target) {
		var handler, input = this._configure(type.constructor, type);
		if (target) {
			console.error("Deprecated API is deprecated", target.spirit);
			if ((handler = target.$oninput || target.oninput)) {
				handler.call(target, input);
			}
		} else {
			gui.Broadcast.dispatch(edb.BROADCAST_OUTPUT, input);
		}
	}
1195055
def update_status(self, callback_function_param=False):
        
        self.logger.debug("Receiver:Updating status")
        self.send_message({MESSAGE_TYPE: TYPE_GET_STATUS},
                          callback_function=callback_function_param)
188288
@Deprecated
    public void addRequestHandler(RequestHandler requestHandler) {
        checkMutability();
        requestHandler2s.add(RequestHandler2.adapt(requestHandler));
    }
35828
def handler(self,data):
		'''
		
		'''
		if isinstance(data,r.models.Response):
			self.log.debug("data is request object =  %s", str(data.content))
			data = data.content
		elif isinstance(data,str):
			self.log.info("data is json string with len %d",len(data))
			if len(data) == 0:
				self.log.warn("Handler received data of 0 length, exiting handler.")
				return
		else:
			self.log.error("Input is not valid request object or json string : %s" %str(data))
			return False
		try:
			data = json.loads(data)
			if 'async-responses' in data.keys():
				self.async_responses_callback(data)
			if 'notifications' in data.keys():
				self.notifications_callback(data)
			if 'registrations' in data.keys():
				self.registrations_callback(data)
			if 'reg-updates' in data.keys():
				self.reg_updates_callback(data)
			if 'de-registrations' in data.keys():
				self.de_registrations_callback(data)
			if 'registrations-expired' in data.keys():
				self.registrations_expired_callback(data)
		except:
			self.log.error("handle router had an issue and threw an exception")
			ex_type, ex, tb = sys.exc_info()
			traceback.print_tb(tb)
			self.log.error(sys.exc_info())
			del tb
366430
def subscribe(self, handler):
        """"""
        assert callable(handler), "Invalid handler %s" % handler
        self.handlers.append(handler)
165200
@Override
  public void doSubscribeNotificationsRequestEvent(ServerShSession session, SubscribeNotificationsRequest request)
      throws InternalException, IllegalDiameterStateException, RouteException, OverloadException {
    // TODO Auto-generated method stub
  }
69709
function notify() {
    var args = arguments
    handlers.forEach(function(f){ f.apply(null, args) }) }
742913
def state_change_handler(self, evt):
        """"""
        datapath = evt.datapath
        assert datapath is not None
        if datapath.id == self._querier.dpid:
            if evt.state == MAIN_DISPATCHER:
                self._querier.start_loop(datapath)
            elif evt.state == DEAD_DISPATCHER:
                self._querier.stop_loop()
660745
function onState(data) {
  if (data.status === social.STATUS.OFFLINE) {
    if (users.hasOwnProperty(data.userId)) {
      delete users[data.userId];
    }
  } else {  //Only track non-offline clients
    users[data.userId] = data;
  }
  sendUsers();

  // Handle my state separately
  if (myClientState !== null && data.clientId === myClientState.clientId) {
    view.postMessage({
      event: 'status',
      online: data.status === social.STATUS.ONLINE
    });
    view.postMessage({'height': data.status === social.STATUS.ONLINE ? 384 : 109});
    if (data.status !== social.STATUS.ONLINE) {
      logger.error('got status ' + data.status + ' from social');
      doLogin();
    }
  }
}