public class ThreadPoolLayoutHandler extends Object implements LithoHandler
LithoHandler.DefaultLithoHandler
Modifier and Type | Field and Description |
---|---|
static LayoutThreadPoolConfiguration |
DEFAULT_LAYOUT_THREAD_POOL_CONFIGURATION |
Modifier and Type | Method and Description |
---|---|
static ThreadPoolLayoutHandler |
getDefaultInstance()
Gets the default static singleton reference to
ThreadPoolLayoutHandler . |
static ThreadPoolLayoutHandler |
getNewInstance(LayoutThreadPoolConfiguration configuration)
Creates a new
ThreadPoolLayoutHandler with the provided configuration. |
boolean |
isTracing() |
void |
post(Runnable runnable,
String tag) |
void |
postAtFront(Runnable runnable,
String tag) |
void |
remove(Runnable runnable) |
public static final LayoutThreadPoolConfiguration DEFAULT_LAYOUT_THREAD_POOL_CONFIGURATION
public static ThreadPoolLayoutHandler getDefaultInstance()
ThreadPoolLayoutHandler
. It is preferred
to use the default thread pool in order prevent the app creating too many threads.ThreadPoolLayoutHandler
.public static ThreadPoolLayoutHandler getNewInstance(LayoutThreadPoolConfiguration configuration)
ThreadPoolLayoutHandler
with the provided configuration. This method will
create a new ThreadPoolExecutor
which can negatively affect the performance of the app.configuration
- LayoutThreadPoolConfiguration
specifying
core and max pool size, and thread priorityThreadPoolExecutor
with specified configuration.public boolean isTracing()
isTracing
in interface LithoHandler
public void post(Runnable runnable, String tag)
post
in interface LithoHandler
public void postAtFront(Runnable runnable, String tag)
postAtFront
in interface LithoHandler
public void remove(Runnable runnable)
remove
in interface LithoHandler