public static class AsyncCompleter.Builder extends Object
AsyncCompleter.| Constructor and Description |
|---|
Builder(Executor executor)
Create a Builder with the supplied Executor
|
| Modifier and Type | Method and Description |
|---|---|
AsyncCompleter |
build() |
AsyncCompleter.Builder |
checkCompletionServiceFutureIdentity() |
AsyncCompleter.Builder |
completionServiceFactory(AsyncCompleter.ExecutorCompletionServiceFactory completionServiceFactory) |
AsyncCompleter.Builder |
handleExceptions(ExceptionPolicy policy) |
AsyncCompleter.Builder |
ignoreExceptions()
Ignore exceptions thrown, note will cause nulls in the resulting
iterable!
|
AsyncCompleter |
limitParallelExecutionTo(int limit)
Create a
AsyncCompleter that limits the number of jobs submitted
to the underlying executor to a hard limit. |
public Builder(@NotNull
Executor executor)
executor - executor to use with the constructed completerpublic AsyncCompleter.Builder ignoreExceptions()
public AsyncCompleter.Builder handleExceptions(ExceptionPolicy policy)
public AsyncCompleter.Builder completionServiceFactory(AsyncCompleter.ExecutorCompletionServiceFactory completionServiceFactory)
public AsyncCompleter.Builder checkCompletionServiceFutureIdentity()
public AsyncCompleter limitParallelExecutionTo(int limit)
AsyncCompleter that limits the number of jobs submitted
to the underlying executor to a hard limit.
Note: this only makes sense if the underlying executor does not have a limit on the number of threads it will create, on the size of the queue submitted jobs will live in, or where the limit is much higher than this limit.
limit - the number of parallel jobs to execute at any one timefor more discussion of how this limit is relevantpublic AsyncCompleter build()
Copyright © 2024 Atlassian. All rights reserved.