Checks wether the context is ready

        -Queries server information (server_info_cb is called)
        -Subscribes to property changes on all sinks (update_cb is called)
336336
def context_notify_cb(self, context, _):
        
        state = pa_context_get_state(context)

        if state == PA_CONTEXT_READY:
            pa_operation_unref(
                pa_context_get_server_info(context, self._server_info_cb, None))

            pa_context_set_subscribe_callback(context, self._update_cb, None)

            pa_operation_unref(pa_context_subscribe(
                context, PA_SUBSCRIPTION_EVENT_CHANGE | PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SERVER, self._success_cb, None))
130
def observe_meta_signal_changes(self, changed_model, prop_name, info):
        "
        self.logger.info(NotificationOverview(info))
957192
def is_ready(self, service_name):
        
        service = self.get_service(service_name)
        reqs = service.get('required_data', [])
        return all(bool(req) for req in reqs)
405069
public static void notifyChange(Context context, Uri uri, ContentObserver observer) {
        ContentResolver resolver = context.getContentResolver();
        resolver.notifyChange(uri, observer);
    }
1337740
def request_update(self, context):
        """"""
        pa_operation_unref(pa_context_get_sink_info_by_name(
            context, self.current_sink.encode(), self._sink_info_cb, None))
1024255
public void onMemberInfoUpdated(AVIMClient client, AVIMConversation conversation,
                                  AVIMConversationMemberInfo memberInfo, List<String> updatedProperties, String operator) {
    LOGGER.d("Notification --- " + operator + " updated memberInfo: " + memberInfo.toString());
  }
765875
private void init(boolean upgrade)
    {
        initAdapter();
        initQueries();
        if (upgrade)
        {
            dbUpgrade();
        }

        // First contact with the DB is version checking (if no connection opened by pool).
        // If DB is in wrong version or not available, just wait for it to be ready.
        boolean versionValid = false;
        while (!versionValid)
        {
            try
            {
                checkSchemaVersion();
                versionValid = true;
            }
            catch (Exception e)
            {
                String msg = e.getLocalizedMessage();
                if (e.getCause() != null)
                {
                    msg += " - " + e.getCause().getLocalizedMessage();
                }
                jqmlogger.error("Database not ready: " + msg + ". Waiting for database...");
                try
                {
                    Thread.sleep(10000);
                }
                catch (Exception e2)
                {
                }
            }
        }
    }
1027225
@Override
    public void notifyChanged() {
        if (getNotification() && getListenerCount() > 0) {
            List<IChemObjectListener> listeners = lazyChemObjectListeners();
            for (Object listener : listeners) {
                ((IChemObjectListener) listener).stateChanged(new QueryChemObjectChangeEvent(this));
            }
        }
    }
840002
def listen_for_updates(self):
        """"""
        self.toredis.subscribe(self.group_pubsub, callback=self.callback)
769787
private static void awaitServerInitialization(JvmAgentConfig pConfig, final Instrumentation instrumentation) {
        List<ServerDetector> detectors = MBeanServerHandler.lookupDetectors();
        for (ServerDetector detector : detectors) {
            detector.jvmAgentStartup(instrumentation);
        }
    }
1197712
private void updateSecurityReadyState() {
        if (!activated) {
            return;
        }

        String unavailableServices = getUnavailableServices();
        if (unavailableServices == null) {
            Tr.info(tc, "SECURITY_SERVICE_READY");
            securityReady = true;

            Dictionary<String, Object> props = new Hashtable<String, Object>();
            props.put("service.vendor", "IBM");
            reg = cc.getBundleContext().registerService(SecurityReadyService.class, this, props);
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "The following required security services are not available: " + unavailableServices);
            }
            securityReady = false;
            if (reg != null) {
                reg.unregister();
                reg = null;
            }
        }
    }
872865
def update(self,
               stats,
               duration=3,
               cs_status=None,
               return_to_browser=False):
        
        # Flush display
        logger.debug('Servers list: {}'.format(stats))
        self.flush(stats)

        # Wait
        exitkey = False
        countdown = Timer(self.__refresh_time)
        while not countdown.finished() and not exitkey:
            # Getkey
            pressedkey = self.__catch_key(stats)
            # Is it an exit or select server key ?
            exitkey = (
                pressedkey == ord('\x1b') or pressedkey == ord('q') or pressedkey == 10)
            if not exitkey and pressedkey > -1:
                # Redraw display
                self.flush(stats)
            # Wait 100ms...
            self.wait()

        return self.active_server
327287
function whenReady(funcToExecute) {
    if (isReady()) {
        logger.info('Page is already loaded, instantly executing!');
        funcToExecute();
        return;
    }

    logger.info('Waiting for page to be ready');
    callbacksOnReady.push(funcToExecute);
}
473771
private boolean allReady() {
    if (currentContext == null) return false;
    List<InstanceContext> instances = new ArrayList<>();
    boolean match = true;
    outer: for (ComponentContext<?> component : currentContext.components()) {
      instances.addAll(component.instances());
      for (InstanceContext instance : component.instances()) {
        if (!ready.contains(instance.address())) {
          match = false;
          break outer;
        }
      }
    }
    return match;
  }
1122617
def update_cb(self, context, t, idx, userdata):
        """"""

        if t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK == PA_SUBSCRIPTION_EVENT_SERVER:
            pa_operation_unref(
                pa_context_get_server_info(context, self._server_info_cb, None))

        self.request_update(context)
162337
def connected(self, **kwargs):
        """"""
        self.bot.log.info('Server config: %r', self.bot.server_config)

        # recompile when I'm sure of my nickname
        self.bot.config['nick'] = kwargs['me']
        self.bot.recompile()

        # Let all plugins know that server can handle commands
        self.bot.notify('server_ready')

        # detach useless events
        self.bot.detach_events(*self.before_connect_events)
1177362
void prepareShutdown() {
        int oldState, newState;
        do {
            oldState = state;
            if ((oldState & CLOSED) != 0) {
                return;
            }
            newState = oldState | CLOSED;
        } while (!stateUpdater.compareAndSet(this, oldState, newState));
        // If there no active requests notify listeners directly
        if (newState == CLOSED) {
            handleCompleted();
        }
    }