Skip to content

Commit

Permalink
Rename AsyncValue -> AsyncResult
Browse files Browse the repository at this point in the history
  • Loading branch information
vsilaev committed Dec 24, 2021
1 parent f877a0e commit 70fb5e7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import java.util.concurrent.Future;

import net.tascalate.async.AsyncGenerator;
import net.tascalate.async.AsyncValue;
import net.tascalate.async.AsyncResult;
import net.tascalate.async.Sequence;
import net.tascalate.async.YieldReply;
import net.tascalate.async.async;
Expand Down Expand Up @@ -98,7 +98,7 @@ CompletableFuture<String> mergeStrings(String delimeter) {
}

@async
AsyncValue<String> iterateStringsEx(int z) {
AsyncResult<String> iterateStringsEx(int z) {
z += 2;
System.out.println(z);
int x = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Future;

public interface AsyncValue<T> extends CompletionStage<T>, Future<T> {
public interface AsyncResult<T> extends CompletionStage<T>, Future<T> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;

import net.tascalate.async.AsyncValue;
import net.tascalate.async.AsyncResult;
import net.tascalate.async.Scheduler;
import net.tascalate.async.suspendable;

Expand Down Expand Up @@ -190,7 +190,7 @@ private void cancelAwaitIfNecessary(CompletableFuture<?> terminateMethod, Comple
}
}

final class ResultPromise<T> extends CompletableFuture<T> implements AsyncValue<T> {
final class ResultPromise<T> extends CompletableFuture<T> implements AsyncResult<T> {

ResultPromise() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ public class AsyncAwaitClassFileGenerator {

private final static Type COMPLETION_STAGE_TYPE = Type.getObjectType("java/util/concurrent/CompletionStage");
private final static Type COMPLETABLE_FUTURE_TYPE = Type.getObjectType("java/util/concurrent/CompletableFuture");
private final static Type ASYNC_VALUE_TYPE = Type.getObjectType("net/tascalate/async/AsyncValue");
private final static Type ASYNC_RESULT_TYPE = Type.getObjectType("net/tascalate/async/AsyncResult");
private final static Type TASCALATE_PROMISE_TYPE = Type.getObjectType("net/tascalate/concurrent/Promise");
private final static Type ASYNC_GENERATOR_TYPE = Type.getObjectType("net/tascalate/async/AsyncGenerator");

private static final Set<Type> ASYNC_TASK_RETURN_TYPES =
Stream.of(COMPLETION_STAGE_TYPE,
COMPLETABLE_FUTURE_TYPE,
ASYNC_VALUE_TYPE,
ASYNC_RESULT_TYPE,
TASCALATE_PROMISE_TYPE,
Type.VOID_TYPE)
.collect(Collectors.toSet());
Expand Down

0 comments on commit 70fb5e7

Please sign in to comment.