Registers an observer that will be notified when clients start and end their sessions.
167619
public void addClientObserver (ClientObserver observer)
    {
        _clobservers.add(observer);
        if (observer instanceof DetailedClientObserver) {
            _dclobservers.add((DetailedClientObserver)observer);
        }
    }
43420
public static void notifyIdleSession(IoSession session, long currentTime) {
        notifyIdleSession0(
                session, currentTime,
                session.getConfig().getIdleTimeInMillis(IdleStatus.BOTH_IDLE),
                IdleStatus.BOTH_IDLE, Math.max(
                    session.getLastIoTime(),
                    session.getLastIdleTime(IdleStatus.BOTH_IDLE)));

        notifyIdleSession0(
                session, currentTime,
                session.getConfig().getIdleTimeInMillis(IdleStatus.READER_IDLE),
                IdleStatus.READER_IDLE, Math.max(
                    session.getLastReadTime(),
                    session.getLastIdleTime(IdleStatus.READER_IDLE)));

        notifyIdleSession0(
                session, currentTime,
                session.getConfig().getIdleTimeInMillis(IdleStatus.WRITER_IDLE),
                IdleStatus.WRITER_IDLE, Math.max(
                    session.getLastWriteTime(),
                    session.getLastIdleTime(IdleStatus.WRITER_IDLE)));

        notifyWriteTimeout(session, currentTime);
    }
1129418
function(expression, onChange, callbackContext) {
    var observer = this._observations.createObserver(expression, onChange, callbackContext || this);
    this._observers.push(observer);
    if (this.observersEnabled) observer.bind(this._context);
    return observer;
  }
493485
function (observer) {
            var self = this, i, observers = self.observers, len = observers.length;
            for (i = 0; i < len; i++) {
                if (observers[i] === observer) {
                    observers.splice(i, 1);
                    break;
                }
            }
            self.checkMemory();
        }
1225508
def ensure_started(self):
        """"""
        if self.active:
            return self
        self._observer = self._observer_class(**self._observer_params)
        self.start()
        self._active = True
        return self
207101
void observe(FolderObserver observer) {
    synchronized (idleMutex) {
      this.observer = observer;
      pushedData = new PushedData();
      idleAcknowledged.set(false);
    }
  }
880402
def start(self):
        
        for config_class in self.watched_configurables:
            monitor = ConfigFileMonitor(config_class, self.config_dir)
            self.observers.append(
                monitor.start(
                    self.add_configurable,
                    self.update_configurable,
                    self.remove_configurable
                )
            )

        wait_on_event(self.shutdown)
895467
protected void register(IConnection conn) {
        if (log.isDebugEnabled()) {
            if (conn == null) {
                log.debug("Register null connection, client id: {}", id);
            } else {
                log.debug("Register connection ({}:{}) client id: {}", conn.getRemoteAddress(), conn.getRemotePort(), id);
            }
        }
        if (conn != null) {
            IScope scope = conn.getScope();
            if (scope != null) {
                log.debug("Registering for scope: {}", scope);
                connections.add(conn);
            } else {
                log.warn("Clients scope is null. Id: {}", id);
            }
        } else {
            log.warn("Clients connection is null. Id: {}", id);
        }
    }
169735
private ClientSession newSession() {
    ClientSession session = new ClientSession(clientId, transport.client(), selector, ioContext, connectionStrategy, sessionTimeout,
                                              unstabilityTimeout
    );

    // Update the session change listener.
    if (changeListener != null)
      changeListener.close();
    changeListener = session.onStateChange(this::onStateChange);

    // Register all event listeners.
    eventListeners.forEach(l -> l.register(session));
    return session;
  }
1054464
@Override
    public void start() throws Exception
    {
        try
        {
            reRegisterServices();
        }
        catch ( KeeperException e )
        {
            log.error("Could not register instances - will try again later", e);
        }
        client.getConnectionStateListenable().addListener(connectionStateListener);
    }
472770
void registerSessionIfNeeded(HttpSession session) {
		if (session != null) {
			synchronized (session) {
				if (!SESSION_MAP_BY_ID.containsKey(session.getId())) {
					sessionCreated(new HttpSessionEvent(session));
				}
			}
		}
	}
1237412
protected function registerCloseCallback()
    {
        $this->swooleServer->on('Close', function ($server, $fd, $reactorId) {
            $this->dispatchEvent('Close', $this, $fd, $reactorId);
        });
    }
606323
public synchronized void notifyObservers(Object arg) {
        for (int i = 0; i < observers.size(); i++) {
            observers.elementAt(i).update(this, arg);
        }
    }
1003854
def _notify_add(self, slice_):
        """"""
        change = AddChange(self, slice_)
        self.notify_observers(change)
243127
public static void register (PerformanceObserver obs, String name, long delta)
    {
        // get the observer's action hashtable
        Map<String, PerformanceAction> actions = _observers.get(obs);
        if (actions == null) {
            // create it if it didn't exist
            _observers.put(obs, actions = Maps.newHashMap());
        }

        // add the action to the set we're tracking
        actions.put(name, new PerformanceAction(obs, name, delta));
    }
1338116
@Override
  public void register(Monitor<?> monitor) {
    SpectatorContext.register(monitor);
    registry.register(monitor);
  }
980630
protected function registerStartCallback()
    {
        $this->swooleServer->on('Start', function () {
            $this->setProcessName("{$this->app->name()} : Master");

            $this->events->dispatch(new Events\ServerStarted($this));

            $this->dispatchEvent('Start', $this);
        });
    }