src/main/java/org/michailov/async/WhenReady.java
private static<S, R> boolean mustExit(CompletableFuture<R> future, WhenReadyArguments<S, R> args) {
        if (future.isDone()) {
            return true;
        }
        
        if (args.timeoutMillis > 0) {
            long currentTimeMillis = System.currentTimeMillis();
            if (currentTimeMillis > args.startTimeMillis + args.timeoutMillis) {
                completeFutureExceptionallySafe(future, new TimeoutException(TIMEOUT_MESSAGE));
                return true;
            }
        }

        return false;
    }
/**
     * Checks whether an apply loop must exit. 
     */
Checks whether an apply loop must exit.
Checks whether an apply loop must exit .
private static<S, R> boolean mustExit(CompletableFuture<R> future, WhenReadyArguments<S, R> args) {
        if (future.isDone()) {
            return true;
        }
        if (args.timeoutMillis > 0) {
            long currentTimeMillis = System.currentTimeMillis();
            if (currentTimeMillis > args.startTimeMillis + args.timeoutMillis) {
                completeFutureExceptionallySafe(future, new TimeoutException(TIMEOUT_MESSAGE));
                return true;
            }
        }
        return false;
    }
private static < S , R > boolean mustExit ( CompletableFuture < R > future , WhenReadyArguments < S , R > args ) { if ( future . isDone ( ) ) { return true ; } if ( args . timeoutMillis > 0 ) { long currentTimeMillis = System . currentTimeMillis ( ) ; if ( currentTimeMillis > args . startTimeMillis + args . timeoutMillis ) { completeFutureExceptionallySafe ( future , new TimeoutException ( TIMEOUT_MESSAGE ) ) ; return true ; } } return false ; }
Checks whether an apply loop must exit.
Checks whether an apply loop must exit .