com.ziqni.admin.sdk.streaming.runnables.ManagementFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ziqni-admin-sdk Show documentation
Show all versions of ziqni-admin-sdk Show documentation
ZIQNI Admin SDK Java Client
/*
* Copyright (c) 2024. ZIQNI LTD registered in England and Wales, company registration number-09693684
*/
package com.ziqni.admin.sdk.streaming.runnables;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
public class ManagementFunction implements Runnable {
private final Supplier function;
private final CompletableFuture completableFuture = new CompletableFuture<>();
private final String jobId;
public ManagementFunction(Supplier function, String jobId) {
assert function != null;
this.function = function;
this.jobId = jobId;
}
@Override
public void run() {
try {
completableFuture.complete(function.get());
}
catch (Throwable t) {
completableFuture.completeExceptionally(t);
}
}
public String getJobId() {
return jobId;
}
public CompletableFuture getCompletableFuture() {
return completableFuture;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy