| Package | Description |
|---|---|
| bayou.async |
Async programming model.
|
| bayou.util |
Miscellaneous types and utilities.
|
| Modifier and Type | Method and Description |
|---|---|
Result<T> |
Fiber.block()
Block the current thread util this fiber completes.
|
Result<T> |
Promise.pollResult()
Implements
Async.pollResult(). |
default Result<T> |
AutoAsync.pollResult()
Implements
Async.pollResult(). |
Result<R> |
AsyncBundle.pollResult()
Implements
Async<R>.pollResult(). |
Result<T> |
Async.pollResult()
Return the result of the action if it is completed; otherwise return null.
|
| Modifier and Type | Method and Description |
|---|---|
List<Result<T>> |
AsyncBundle.pollTaskResults()
Return an immutable list of results from currently completed tasks.
|
static <T> FunctionX<List<Result<T>>,List<T>> |
AsyncBundle.triggerOf(int successThreshold,
int taskCount)
Return a simple trigger function
that's based the number of success results.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Promise.complete(Result<T> result)
Complete this Promise with `result`.
|
| Modifier and Type | Method and Description |
|---|---|
void |
AsyncBundle.onCompletion(Consumer<Result<R>> callback)
Implements
Async<R>.onCompletion(). |
void |
Promise.onCompletion(Consumer<Result<T>> callback)
Implements
Async.onCompletion(Consumer). |
default void |
AutoAsync.onCompletion(Consumer<Result<T>> callback)
Implements
Async.onCompletion(Consumer). |
void |
Async.onCompletion(Consumer<Result<T>> callback)
Register a callback that will be invoked after the action is completed.
|
default <R> Async<R> |
Async.transform(FunctionX<Result<T>,Async<R>> func)
After `this` action completes, invoke a function to transform the result.
|
| Constructor and Description |
|---|
AsyncBundle(Stream<Async<T>> tasks,
FunctionX<List<Result<T>>,R> trigger)
Create a bundle over the tasks, with the trigger function.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Result<T> |
Result.call(Callable<T> action)
Invoke
action.call(), convert the outcome to a Result. |
static <T> Result<T> |
Result.failure(Exception exception)
Create a failure Result with the
exception. |
default Result<T> |
Result.pollResult()
Implements
Async.pollResult(); by default, return `this`. |
static <T> Result<T> |
Result.success(T value)
Create a success Result with the
value. |
default Result<T> |
Result.timeout(Duration duration)
|
| Modifier and Type | Method and Description |
|---|---|
default void |
Result.onCompletion(Consumer<Result<T>> callback)
Implements
Async.onCompletion(Consumer). |