src/main/java/org/michailov/async/AsyncAgent.java
private void ensureMode(WhenReadyMode mode) {
        // The agent must be in idle mode.
        if (_mode != WhenReadyMode.IDLE) {
            throw new IllegalStateException("There is already an operation in progress. Await for the returned CompletableFuture to complete, and then retry.");
        }
        
        _mode = mode;
    }
/**
     * Ensures the current mode is good for starting a new operation.
     * 
     * @param   mode    The mode of the operation.
     */
Ensures the current mode is good for starting a new operation.

@param   mode    The mode of the operation.
Ensures the current mode is good for starting a new operation . @param mode The mode of the operation .
private void ensureMode(WhenReadyMode mode) {
        if (_mode != WhenReadyMode.IDLE) {
            throw new IllegalStateException("There is already an operation in progress. Await for the returned CompletableFuture to complete, and then retry.");
        }
        _mode = mode;
    }
private void ensureMode ( WhenReadyMode mode ) { if ( _mode != WhenReadyMode . IDLE ) { throw new IllegalStateException ( "There is already an operation in progress. Await for the returned CompletableFuture to complete, and then retry." ) ; } _mode = mode ; }
Ensures the current mode is good for starting a new operation.
Ensures the current mode is good for starting a new operation .
// The agent must be in idle mode.
