Example usage for org.springframework.ide.eclipse.boot.util Thunk call

List of usage examples for org.springframework.ide.eclipse.boot.util Thunk call

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.util Thunk call.

Prototype

void call() throws Exception;

Source Link

Usage

From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryClientTest.java

private Future<Void> doAsync(Thunk task) {
    CompletableFuture<Void> result = new CompletableFuture<>();
    Job job = new Job("Async task") {
        protected IStatus run(IProgressMonitor monitor) {
            try {
                task.call();
                result.complete(null);/*from   www. j  a va2 s  .co  m*/
            } catch (Throwable e) {
                result.completeExceptionally(e);
            }
            return Status.OK_STATUS;
        }
    };
    job.schedule();
    return result;
}