56 |
|
* restrict usages to only those methods defined in interface |
57 |
|
* CompletionStage, use method {@link #minimalCompletionStage}. Or to |
58 |
|
* ensure only that clients do not themselves modify a future, use |
59 |
< |
* method {@link copy}. </li> </ul> |
59 |
> |
* method {@link #copy}. </li> </ul> |
60 |
|
* |
61 |
|
* <p>CompletableFuture also implements {@link Future} with the following |
62 |
|
* policies: <ul> |
999 |
|
d.completeRelay(s); |
1000 |
|
else { |
1001 |
|
UniRelay<V> c = new UniRelay<V>(d, g); |
1002 |
< |
push(c); |
1002 |
> |
g.push(c); |
1003 |
|
c.tryFire(SYNC); |
1004 |
|
} |
1005 |
|
return d; |
2632 |
|
this.delay = delay; this.unit = unit; this.executor = executor; |
2633 |
|
} |
2634 |
|
public void execute(Runnable r) { |
2635 |
< |
Delayer.delay(new Submitter(executor, r), delay, unit); |
2635 |
> |
Delayer.delay(new TaskSubmitter(executor, r), delay, unit); |
2636 |
|
} |
2637 |
|
} |
2638 |
|
|
2639 |
< |
/** Delay action to asynchronously start user task */ |
2640 |
< |
static final class Submitter implements Runnable { |
2639 |
> |
/** Action to submit user task */ |
2640 |
> |
static final class TaskSubmitter implements Runnable { |
2641 |
|
final Executor executor; |
2642 |
|
final Runnable action; |
2643 |
< |
Submitter(Executor executor, Runnable action) { |
2643 |
> |
TaskSubmitter(Executor executor, Runnable action) { |
2644 |
|
this.executor = executor; |
2645 |
|
this.action = action; |
2646 |
|
} |
2657 |
|
} |
2658 |
|
} |
2659 |
|
|
2660 |
< |
/** Action to completeExceptionally on timeout */ |
2660 |
> |
/** Action to complete on timeout */ |
2661 |
|
static final class DelayedCompleter<U> implements Runnable { |
2662 |
|
final CompletableFuture<U> f; |
2663 |
|
final U u; |