AbstractDataSource

This commit is contained in:
redkale
2023-10-16 11:21:13 +08:00
parent b1f91d3b8a
commit a32586bf3b

View File

@@ -309,6 +309,14 @@ public abstract class AbstractDataSource extends AbstractService implements Data
return executor;
}
protected <T> void complete(CompletableFuture<T> future, T value) {
getExecutor().execute(() -> future.complete(value));
}
protected <T> void completeExceptionally(CompletableFuture<T> future, Throwable exp) {
getExecutor().execute(() -> future.completeExceptionally(exp));
}
protected String executorToString() {
ExecutorService executor = this.sourceExecutor;
if (executor == null) {