Promise.Completable
public interface Promise<C>
Modifier and Type | Interface | Description |
---|---|---|
static class |
Promise.Completable<S> |
A CompletableFuture that is also a Promise.
|
Modifier and Type | Field | Description |
---|---|---|
static Promise<?> |
NOOP |
Shared instance whose methods are implemented empty,
|
Modifier and Type | Method | Description |
---|---|---|
default void |
fail(Throwable failure) |
Callback to invoke when the operation fails.
|
static <T> Promise<T> |
from(Consumer<T> succeed,
Consumer<Throwable> fail) |
|
static <T> Promise<T> |
noop() |
|
default void |
succeed(C result) |
Callback to invoke when the operation succeeds.
|
default void succeed(C result)
Callback to invoke when the operation succeeds.
result
- the resultfail(Throwable)
default void fail(Throwable failure)
Callback to invoke when the operation fails.
failure
- the operation failurestatic <T> Promise<T> noop()
Copyright © 2008–2017 The CometD Project. All rights reserved.