lib/ycmd/server.py
def wait_for_status(self, status=None, timeout=None):
        '''
        Waits for the server status to change.

        If `status` is omitted, any status change will cause this to return.
        Otherwise, if `status` is a `Server` constant, then this will block
        until that status is reached. If `status` is a `list` of constants,
        then any status in that list will be awaited.

        If `timeout` is omitted, this will block indefinitely.
        Otherwise, `timeout` should be the number of seconds to wait for until
        a `TimeoutError` is raised.
        '''
        def _wait_condition(status=status):
            if status is None:
                return True

            if isinstance(status, (tuple, list)):
                return self._status in status

            return self._status == status

        with self._lock:
            # check if already satisfied from the start, and return if so
            if _wait_condition():
                return

            # otherwise, wait for status change notification and check again
            is_condition_satisfied = self._status_cv.wait_for(
                _wait_condition, timeout=timeout,
            )

            # cv does not raise exception timeout, it returns false instead
            # catch that and raise `TimeoutError` when it returns `False`
            if not is_condition_satisfied:
                raise TimeoutError

        Waits for the server status to change.

        If `status` is omitted, any status change will cause this to return.
        Otherwise, if `status` is a `Server` constant, then this will block
        until that status is reached. If `status` is a `list` of constants,
        then any status in that list will be awaited.

        If `timeout` is omitted, this will block indefinitely.
        Otherwise, `timeout` should be the number of seconds to wait for until
        a `TimeoutError` is raised.
        
Waits for the server status to change.
If `status` is omitted, any status change will cause this to return.
Otherwise, if `status` is a `Server` constant, then this will block
until that status is reached. If `status` is a `list` of constants,
then any status in that list will be awaited.

If `timeout` is omitted, this will block indefinitely.
Otherwise, `timeout` should be the number of seconds to wait for until
a `TimeoutError` is raised.
Waits for the server status to change . If ` status ` is omitted any status change will cause this to return . Otherwise if ` status ` is a ` Server ` constant then this will block until that status is reached . If ` status ` is a ` list ` of constants then any status in that list will be awaited . If ` timeout ` is omitted this will block indefinitely . Otherwise ` timeout ` should be the number of seconds to wait for until a ` TimeoutError ` is raised .
def wait_for_status(self, status=None, timeout=None):
        def _wait_condition(status=status):
            if status is None:
                return True
            if isinstance(status, (tuple, list)):
                return self._status in status
            return self._status == status
        with self._lock:
            if _wait_condition():
                return
            is_condition_satisfied = self._status_cv.wait_for(
                _wait_condition, timeout=timeout,
            )
            if not is_condition_satisfied:
                raise TimeoutError
def wait_for_status ( self , status = None , timeout = None ) : def _wait_condition ( status = status ) : if status is None : return True if isinstance ( status , ( tuple , list ) ) : return self . _status in status return self . _status == status with self . _lock : if _wait_condition ( ) : return is_condition_satisfied = self . _status_cv . wait_for ( _wait_condition , timeout = timeout , ) if not is_condition_satisfied : raise TimeoutError
Waits for the server status to change.
Waits for the server status to change .
'''
        Waits for the server status to change.

        If `status` is omitted, any status change will cause this to return.
        Otherwise, if `status` is a `Server` constant, then this will block
        until that status is reached. If `status` is a `list` of constants,
        then any status in that list will be awaited.

        If `timeout` is omitted, this will block indefinitely.
        Otherwise, `timeout` should be the number of seconds to wait for until
        a `TimeoutError` is raised.
        ''' # check if already satisfied from the start, and return if so # otherwise, wait for status change notification and check again # cv does not raise exception timeout, it returns false instead # catch that and raise `TimeoutError` when it returns `False`
self
status
timeout