Waits for data forever and feeds the input queue.
182849
def _recv_loop(self):
        
        while True:
            try:
                data = self._socket.recv(4096)
                self._ibuffer += data
                while '\r\n' in self._ibuffer:
                    line, self._ibuffer = self._ibuffer.split('\r\n', 1)
                    self.iqueue.put(line)
            except Exception:
                break
1137605
def process_forever(self, timeout=0.2):
        
        # This loop should specifically *not* be mutex-locked.
        # Otherwise no other thread would ever be able to change
        # the shared state of a Reactor object running this function.
        log.debug("process_forever(timeout=%s)", timeout)
        self._looping.set()
        while self._looping.is_set():
            self.process_once(timeout)
213259
def serve(self):
        """"""
        while self.ready:
            try:
                self.tick()
            except (KeyboardInterrupt, SystemExit):
                raise
            except Exception:
                self.error_log(
                    'Error in HTTPServer.tick', level=logging.ERROR,
                    traceback=True,
                )

            if self.interrupt:
                while self.interrupt is True:
                    # Wait for self.stop() to complete. See _set_interrupt.
                    time.sleep(0.1)
                if self.interrupt:
                    raise self.interrupt
1157492
private void doFeed() {
    if (fed && !output.sendQueueFull()) {
      fed = false;
      vertx.runOnContext(feedRunner);
    } else {
      feedTimer = vertx.setTimer(feedDelay, recursiveRunner);
    }
  }
1097866
def serve_forever(self):
        """"""

        # Test if client and server are in the same major version
        if not self.login():
            logger.critical("The server version is not compatible with the client")
            self.end()
            return self.client_mode

        exitkey = False
        try:
            while True and not exitkey:
                # Update the stats
                cs_status = self.update()

                # Update the screen
                if not self.quiet:
                    exitkey = self.screen.update(self.stats,
                                                 cs_status=cs_status,
                                                 return_to_browser=self.return_to_browser)

                # Export stats using export modules
                self.stats.export(self.stats)
        except Exception as e:
            logger.critical(e)
            self.end()

        return self.client_mode
1302831
public void waitForUpdate() {

        CmsWaitHandle handle = new CmsWaitHandle(true);
        addWaitHandle(handle);
        handle.enter(Long.MAX_VALUE);
    }
973169
def flush(self):
        
        if self.debug:
            sys.stderr.write("%s: FLUSH INPUT (%i bytes waiting)\n" %(
                    self.__class__.__name__,
                    self.ser.inWaiting()
                    ))
        self.ser.flushInput()
942993
def feed_data(self, data):
        """"""
        if data:
            self._bytes.append(data)
            if self.parser.stream:
                self.parser.stream(self)
            else:
                self.parser.buffer.extend(data)
214372
async def run_forever(self, relax=0.1, offset=None, timeout=20, allowed_updates=None):
        
        while 1:
            try:
                result = await self._bot.getUpdates(offset=offset,
                                                    timeout=timeout,
                                                    allowed_updates=allowed_updates)

                # Once passed, this parameter is no longer needed.
                allowed_updates = None

                # No sort. Trust server to give messages in correct order.
                for update in result:
                    self._update_handler(update)
                    offset = update['update_id'] + 1

            except CancelledError:
                break
            except exception.BadHTTPResponse as e:
                traceback.print_exc()

                # Servers probably down. Wait longer.
                if e.status == 502:
                    await asyncio.sleep(30)
            except:
                traceback.print_exc()
                await asyncio.sleep(relax)
            else:
                await asyncio.sleep(relax)
1322335
public void waitForExit() throws InterruptedException {
        try {
            dockerClient.waitContainer(container.id());
        } catch (DockerException e) {
            throw new IllegalStateException(e);
        }
    }
1005419
def wait(self, key, index=0, recursive=False, sorted=False, quorum=False,
             timeout=None):
        """"""
        return self.adapter.get(key, recursive=recursive, sorted=sorted,
                                quorum=quorum, wait=True, wait_index=index,
                                timeout=timeout)
642512
def wait(self):
        """"""
        now = _monotonic()
        if now < self._ref:
            delay = max(0, self._ref - now)
            self.sleep_func(delay)
        self._update_ref()
707806
def feed(self, data):
        
        self._lock.acquire()
        try:
            if self._event is not None:
                self._event.set()
            self._buffer.fromstring(data)
            self._cv.notifyAll()
        finally:
            self._lock.release()
1363793
public function wait(): void
    {
        while (!$this->stream->eof()) {
            $frame = $this->readFrame();

            if (null !== $frame) {
                if (!\is_array($frame)) {
                    $frame = [$frame];
                }

                foreach ($this->onNewFrameCallables as $newFrameCallable) {
                    \call_user_func_array($newFrameCallable, $frame);
                }
            }
        }
    }
211148
def _process_incoming_data(self):
        
        while self._running.is_set():
            if self.poller.is_ready:
                self.data_in += self._receive()
                self.data_in = self._on_read_impl(self.data_in)
601736
def serve_forever(self, poll_interval=0.5):
        
        while self.is_alive:
            self.handle_request()
            time.sleep(poll_interval)
1150356
def process(self, blob):
        """"""
        # self._add_process_dt()
        try:
            log.debug("Waiting for queue items.")
            prefix, data = self.queue.get(timeout=self.timeout)
            log.debug("Got {0} bytes from queue.".format(len(data)))
        except Empty:
            log.warning(
                "ControlHost timeout ({0}s) reached".format(self.timeout)
            )
            raise StopIteration("ControlHost timeout reached.")
        blob[self.key_for_prefix] = prefix
        blob[self.key_for_data] = data
        return blob