Ask for a new file, using the superclass method, but if none is found,
wait for a while and ask again. This will continue until we get a server
shutdown signal.
770760
@Override
    protected synchronized JournalInputFile openNextFile()
            throws JournalException {
        while (open) {
            JournalInputFile nextFile = super.openNextFile();
            if (nextFile != null) {
                return nextFile;
            }
            try {
                wait(pollingIntervalMillis);
            } catch (InterruptedException e) {
                // no special action on interrupt.
            }
        }
        return null;
    }
493896
@FFDCIgnore({ InterruptedException.class })
    public synchronized void waitForComplete() {
        // Don't bother waiting if the vm has been shutdown in the meanwhile...
        while (done.get() == false && !shutdownHook.vmShutdown()) {
            try {
                // refresh packages should not take a long time..
                wait(1000);
            } catch (InterruptedException e) {
                /** No-op **/
            }
        }
    }
243765
public void waitForExit()
    throws IOException
  {
    Thread thread = Thread.currentThread();
    ClassLoader oldLoader = thread.getContextClassLoader();
    
    try {
      thread.setContextClassLoader(_systemManager.getClassLoader());
      
      _waitForExitService = new WaitForExitService3(this, 
                                                    _systemManager);

      _waitForExitService.waitForExit();
    } finally {
      thread.setContextClassLoader(oldLoader);
    }
  }
847969
public void service(HttpServletRequest req, HttpServletResponse resp) 
        throws ServletException, IOException
    {
	    boolean fileFound = sendResourceFile(req, resp);
		if (!fileFound)
		    resp.sendError(HttpServletResponse.SC_NOT_FOUND, "File not found");
//    	super.service(req, resp);
    }
520090
def wait(*args)
      pattern = args.pop
      unless pattern
        raise ArgumentError, 'Please provide condition to wait for'
      end

      run(*args) do |out, _|
        raise if out =~ /#{pattern}/
      end
    rescue ExitError
      # noop
    end
677484
def wait_for_exists(self, timeout=0, *args, **selectors):
        
        return self.device(**selectors).wait.exists(timeout=timeout)
1044329
private S waitForCompletionAndThrowIfUploadFailed() throws IOException {
    try {
      return uploadOperation.get();
    } catch (InterruptedException e) {
      // If we were interrupted, we need to cancel the upload operation.
      uploadOperation.cancel(true);
      IOException exception = new ClosedByInterruptException();
      exception.addSuppressed(e);
      throw exception;
    } catch (ExecutionException e) {
      if (e.getCause() instanceof Error) {
        throw (Error) e.getCause();
      }
      throw new IOException("Upload failed", e.getCause());
    }
  }
1274166
def send_request(self, *args, **kwargs):
        
        try:
            return super(JSHost, self).send_request(*args, **kwargs)
        except RequestsConnectionError as e:
            if (
                self.manager and
                self.has_connected and
                self.logfile and
                'unsafe' not in kwargs
            ):
                raise ProcessError(
                    '{} appears to have crashed, you can inspect the log file at {}'.format(
                        self.get_name(),
                        self.logfile,
                    )
                )
            raise six.reraise(RequestsConnectionError, RequestsConnectionError(*e.args), sys.exc_info()[2])
916250
public void pleaseStop()
    {
    	if (stopRequired)
    		return;
    	
        stopRequired = true;
        try
        {
            if (receiver != null)
                receiver.close();
        }
        catch (JMSException e)
        {
        	ErrorTools.log(e, log);
        }
    }
1033962
private void checkFile() throws IORuntimeException {
		if (false == file.exists()) {
			throw new IORuntimeException("File not exist: " + file);
		}
		if (false == file.isFile()) {
			throw new IORuntimeException("Not a file:" + file);
		}
	}
1122155
def wait_for_download
      if pending?
        logger.info 'Waiting for first download'

        if logger.respond_to? :flush
          logger.flush
        end

        while pending?
          sleep 0.1
        end
      end
    end
246620
def _get_file(self, fn, timeout=30):
        '''
        '''
        msg = FILE_MAP.get(fn, None)
        if msg is None:
            raise FileNotFoundError('Cannot get file {!r}. Available file '
                                    'requests are: {}'
                                    .format(fn, ', '.join(FILE_MAP.keys())))
        result = self._loop.run_until_complete(
            self._protocol.send_package(msg, timeout=timeout))
        return result
309540
protected final void waitForDeliverySync()
    {
    	List<AbstractSession> sessionsSnapshot = new ArrayList<>(sessions.size());
        synchronized (sessions)
        {
        	sessionsSnapshot.addAll(sessions.values());
        }
        for(int n=0;n<sessionsSnapshot.size();n++)
        {
            AbstractSession session = sessionsSnapshot.get(n);
            session.waitForDeliverySync();
        }
    }
955518
private void maybeSendNewPermitRequest() {
    if (!this.requestSemaphore.tryAcquire()) {
      return;
    }
    if (!this.retryStatus.canRetryNow()) {
      this.requestSemaphore.release();
      return;
    }
    try {
      long permits = computeNextPermitRequest();
      if (permits <= 0) {
        this.requestSemaphore.release();
        return;
      }

      PermitRequest permitRequest = this.basePermitRequest.copy();
      permitRequest.setPermits(permits);
      permitRequest.setMinPermits((long) this.permitsOutstanding.getAverageWeightOrZero());
      permitRequest.setVersion(ThrottlingProtocolVersion.WAIT_ON_CLIENT.ordinal());
      if (BatchedPermitsRequester.this.restRequestHistogram != null) {
        BatchedPermitsRequester.this.restRequestHistogram.update(permits);
      }

      log.debug("Sending permit request " + permitRequest);

      this.requestSender.sendRequest(permitRequest, new AllocationCallback(
          BatchedPermitsRequester.this.restRequestTimer == null ? NoopCloseable.INSTANCE :
              BatchedPermitsRequester.this.restRequestTimer.time(), new Sleeper()));
    } catch (CloneNotSupportedException cnse) {
      // This should never happen.
      this.requestSemaphore.release();
      throw new RuntimeException(cnse);
    }
  }
264705
def _process_file_continue_response(self, response: HTTPResponse):
        ''''''
        code = response.status_code

        if code == http.client.PARTIAL_CONTENT:
            self.open_file(self._filename, response, mode='ab+')
        else:
            self._raise_cannot_continue_error()
682578
function runNextRequest(){
		var self = this;

		var req = parser.read()
		if (req){
			var res = new Response(req);
			res.assignSocket(socket)

			//No matter how the response object gets closed this
			//will trigger the next one if there is one.
			res.once('close', function(){
				//Check if there is work.
				if(self.work){
					runNextRequest.call(self)
				} else {
					//Let the system know that you have stopped working
					self.working = false;
				}
			});

			this.emit('request', req, res);		
		}
	}
1132310
function (file_system) {
                if (file_system) {
                    if (successCallback) {
                        fileSystems.getFs(file_system.name, function (fs) {
                            // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
                            if (!fs) {
                                fs = new FileSystem(file_system.name, file_system.root);
                            }
                            successCallback(fs);
                        });
                    }
                } else {
                    // no FileSystem object returned
                    fail(FileError.NOT_FOUND_ERR);
                }
            }