io.vertx.ext.unit.Completion Maven / Gradle / Ivy
package io.vertx.ext.unit;
import io.vertx.codegen.annotations.GenIgnore;
import io.vertx.codegen.annotations.Nullable;
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Promise;
/**
* A completion object that emits completion notifications either succeeded or failed.
*
* @author Julien Viet
*/
@VertxGen
public interface Completion {
/**
* Completes the future upon completion, otherwise fails it.
*
* @param future the future to resolve
*/
void resolve(Promise future);
/**
* @return true if this completion is completed
*/
boolean isCompleted();
/**
* @return true if this completion is completed and succeeded
*/
boolean isSucceeded();
/**
* @return true if the this completion is completed and failed
*/
boolean isFailed();
/**
* Completion handler to receive a completion signal when this completions completes.
*
* @param completionHandler the completion handler
*/
void handler(Handler> completionHandler);
/**
* Cause the current thread to wait until this completion completes.
*
* If the current thread is interrupted, an exception will be thrown.
*/
void await();
/**
* Cause the current thread to wait until this completion completes with a configurable timeout.
*
* If completion times out or the current thread is interrupted, an exception will be thrown.
*
* @param timeoutMillis the timeout in milliseconds
*/
void await(long timeoutMillis);
/**
* Cause the current thread to wait until this completion completes and succeeds.
*
* If the current thread is interrupted or the suite fails, an exception will be thrown.
*/
void awaitSuccess();
/**
* Cause the current thread to wait until this completion completes and succeeds with a configurable timeout.
*
* If completion times out or the current thread is interrupted or the suite fails, an exception will be thrown.
*
* @param timeoutMillis the timeout in milliseconds
*/
void awaitSuccess(long timeoutMillis);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy