public class TinyAsyncBuilder extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
TinyAsyncBuilder() |
| Modifier and Type | Method and Description |
|---|---|
TinyAsync |
build() |
TinyAsyncBuilder |
caller(AsyncCaller caller)
Specify an asynchronous caller implementation.
|
TinyAsyncBuilder |
callerExecutor(ExecutorService callerExecutor)
Specify a separate executor to use for caller (internal handle) invocation.
|
TinyAsyncBuilder |
clockSource(ClockSource clockSource) |
TinyAsyncBuilder |
executor(ExecutorService executor)
Configure the default executor to use for caller invocation,and asynchronous tasks submitted
through
AsyncFramework.call(Callable). |
TinyAsyncBuilder |
maxRecursionDepth(long maxRecursionDepth)
Configure how many recursions should be allowed.
|
TinyAsyncBuilder |
recursionSafe(boolean recursionSafe)
Configure that all caller invocations should use a recursion safe mechanism.
|
TinyAsyncBuilder |
scheduler(ScheduledExecutorService scheduler)
Specify a scheduler to use with the built TinyAsync instance.
|
TinyAsyncBuilder |
threaded(boolean threaded)
Configure that all caller invocation, and async tasks should be using a thread pool.
|
public TinyAsyncBuilder threaded(boolean threaded)
This will cause the configuration of TinyTask to throw an exception if an executor service is not available for all purposes.
threaded - Set true if all tasks should be executed on a thread pool, false otherwise.public TinyAsyncBuilder recursionSafe(boolean recursionSafe)
Recursion is tracked for all threads that call the AsyncCallers.
This will make even the non-threaded caller use a thread in the case of deep recursion.
recursionSafe - Set true if all caller invocations should be done with
a recursion safe mechanism, false otherwise.public TinyAsyncBuilder maxRecursionDepth(long maxRecursionDepth)
recursionSafe.maxRecursionDepth - The max number of times that a caller may go through
AsyncCaller in a single thread.public TinyAsyncBuilder caller(AsyncCaller caller)
The 'caller' defines how handles are invoked. The simplest implementations are based of
DirectAsyncCaller , which causes the call to be performed directly in the calling
thread.
caller - public TinyAsyncBuilder executor(ExecutorService executor)
AsyncFramework.call(Callable).executor - Executor to use.public TinyAsyncBuilder callerExecutor(ExecutorService callerExecutor)
Implies use of threaded caller.
callerExecutor - Executor to use for callers.public TinyAsyncBuilder scheduler(ScheduledExecutorService scheduler)
scheduler - The scheduler to use.public TinyAsyncBuilder clockSource(ClockSource clockSource)
public TinyAsync build()
Copyright © 2017. All rights reserved.