Wait for all pending results to be finished. If timeout is set,
        return after this many seconds regardless.

        :param timeout: timeout period in seconds (defaults to forever)
        :returns: True if all the results completed
484467
def wait( self, timeout = -1 ):
        """"""

        # we can't use ipyparallel.Client.wait() for this, because that
        # method only works for cases where the Client object is the one that
        # submitted the jobs to the cluster hub -- and therefore has the
        # necessary data structures to perform synchronisation. This isn't the
        # case for us, as one of the main goals of epyc is to support disconnected
        # operation, which implies a different Client object retrieving results
        # than the one that submitted the jobs in the first place. This is
        # unfortunate, but understandable given the typical use cases for
        # Client objects.
        #
        # Instead. we have to code around a little busily. The ClusterLab.WaitingTime
        # global sets the latency for waiting, and we repeatedly wait for this amount
        # of time before updating the results. The latency value essentially controls
        # how busy this process is: given that most simulations are expected to
        # be long, a latency in the tens of seconds feels about right as a default
        if self.numberOfPendingResults() > 0:
            # we've got pending results, wait for them
            timeWaited = 0
            while (timeout < 0) or (timeWaited < timeout):
                if self.numberOfPendingResults() == 0:
                    # no pending jobs left, we're complete
                    return True
                else:
                    # not done yet, calculate the waiting period
                    if timeout == -1:
                        # wait for the default waiting period
                        dt = self.WaitingTime
                    else:
                        # wait for the default waiting period or until the end of the timeout.
                        # whichever comes first
                        if (timeout - timeWaited) < self.WaitingTime:
                            dt = timeout - timeWaited
                        else:
                            dt = self.WaitingTime
                            
                    # sleep for a while
                    time.sleep(dt)
                    timeWaited = timeWaited + dt

            # if we get here, the timeout expired, so do a final check
            # and then exit
            return (self.numberOfPendingResults() == 0)

        else:
            # no results, so we got them all
            return True
439342
def first(self, timeout=None):
        
        while True:
            with self._jobfinished:
                if self._results or not self._jobs.unfinished_tasks:
                    break
                self._jobfinished.wait(timeout)
        return self._results[0] if self._results else None
662339
def timeout(self, timeout):
        

        if timeout is None:
            self._timeout = None  # no timeout
            return
        self._timeout = float(timeout)
1164076
public void waitUntilComplete(long timeout) {
        long base=System.currentTimeMillis();
        long now=0;
        lock.lock();
        try {
            while(processing || count.get() > 0) {
                long delay=timeout-now;
                if(delay <= 0)
                    break;
                try {
                    processing_done.await(delay, TimeUnit.MILLISECONDS);
                    now=System.currentTimeMillis()-base;
                }
                catch(InterruptedException e) {
                }
            }
        }
        finally {
            lock.unlock();
        }
    }
378180
def join(self, timeout: Union[float, datetime.timedelta] = None) -> Awaitable[None]:
        
        return self._finished.wait(timeout)
560878
def wait(self, timeout):
        """"""
        self.condition.acquire()
        self.condition.wait(timeout // 1000)
        self.condition.release()
964545
def wait_all_tasks_done(self, timeout=None, delay=0.5, interval=0.1):
        """"""
        timeout = self._timeout if timeout is None else timeout
        timeout = timeout or float("inf")
        start_time = time.time()
        time.sleep(delay)
        while 1:
            if not self.todo_tasks:
                return self.all_tasks
            if time.time() - start_time > timeout:
                return self.done_tasks
            time.sleep(interval)
947108
def wait_until_done(self, timeout=None):
        """"""
        start = datetime.now()
        if not self.__th:
            raise IndraDBRestResponseError("There is no thread waiting to "
                                           "complete.")
        self.__th.join(timeout)
        now = datetime.now()
        dt = now - start
        if self.__th.is_alive():
            logger.warning("Timed out after %0.3f seconds waiting for "
                           "statement load to complete." % dt.total_seconds())
            ret = False
        else:
            logger.info("Waited %0.3f seconds for statements to finish loading."
                        % dt.total_seconds())
            ret = True
        return ret
1263675
async def wait_with_timeout(self, timeout, *matchers):
        
        if timeout is None:
            ev, m = await M_(*matchers)
            return False, ev, m
        else:
            th = self.scheduler.setTimer(timeout)
            try:
                tm = TimerEvent.createMatcher(th)
                ev, m = await M_(*(tuple(matchers) + (tm,)))
                if m is tm:
                    return True, None, None
                else:
                    return False, ev, m
            finally:
                self.scheduler.cancelTimer(th)
443363
def wait_until_jquery_requests_are_closed(self, timeout=None):
        
        timeout = timeout if timeout is not None else self.timeout

        def wait():
            '''
            Wait function passed to executor
            '''
            WebDriverWait(self.driver, timeout).until(
                lambda d: self.js_executor.execute_template('isJqueryAjaxComplete', {}))
            return True

        return self.execute_and_handle_webdriver_exceptions(
            wait, timeout, None, 'Timeout waiting for all jQuery AJAX requests to close')
157103
def _wait_for_results(self):
        
        while True:
            get_timeout = self._next_timeout()
            try:
                msgtype, value = self.queue.get(timeout=get_timeout)
            except QueueEmpty:
                raise dbt.exceptions.RPCTimeoutException(self.timeout)

            if msgtype == QueueMessageType.Log:
                self.logs.append(value)
            elif msgtype in QueueMessageType.terminating():
                return msgtype, value
            else:
                raise dbt.exceptions.InternalException(
                    'Got invalid queue message type {}'.format(msgtype)
                )
737583
def wait(self, *, timeout=None):
        
        for _ in self.get_results(block=True, timeout=timeout):  # pragma: no cover
            pass
181272
def wait(self, timeout=None):
    

    if not self.__running:
      raise RuntimeError("ThreadPool ain't running")
    self.__queue.wait(timeout)
184196
def wait(wait_time):
    

    LOGGER.debug("> Waiting '{0}' seconds!".format(wait_time))

    time.sleep(wait_time)
    return True
964489
def wait(timeout = nil)
      raise ConditionError, "cannot wait for signals while exclusive" if Celluloid.exclusive?

      if actor = Thread.current[:celluloid_actor]
        task = Task.current
        if timeout
          bt = caller
          timer = actor.timers.after(timeout) do
            exception = ConditionError.new("timeout after #{timeout.inspect} seconds")
            exception.set_backtrace bt
            task.resume exception
          end
        end
      else
        task = Thread.current
      end
      waiter = Waiter.new(self, task, Celluloid.mailbox, timeout)

      @mutex.synchronize do
        @waiters << waiter
      end

      result = Celluloid.suspend :condwait, waiter
      timer.cancel if timer
      raise result if result.is_a?(ConditionError)
      return yield(result) if block_given?
      result
    end
14213
def wait(self):
        
        self.wait_event = threading.Event()
        timeout = int(self.timeout) if self.timeout else None
        self.timed_out = not self.wait_event.wait(timeout)
220541
public boolean waitForDialogToClose(long timeout) {
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "waitForDialogToClose("+timeout+")");
		}
		
		return dialogUtils.waitForDialogToClose(timeout);
	}