public class TaskChainFactory extends Object
Constructor and Description |
---|
TaskChainFactory(GameInterface impl) |
Modifier and Type | Method and Description |
---|---|
BiConsumer<Exception,TaskChainTasks.Task<?,?>> |
getDefaultErrorHandler()
Returns the default error handler that will be used by all chains created by this factory,
if they do not suspply their own error handler.
|
Map<String,Queue<co.aikar.taskchain.SharedTaskChain>> |
getSharedChains() |
<T> TaskChain<T> |
newChain()
Creates a new chain.
|
<T> TaskChain<T> |
newSharedChain(String name)
Allows re-use of a Chain by giving it a name.
|
void |
setDefaultErrorHandler(BiConsumer<Exception,TaskChainTasks.Task<?,?>> errorHandler)
Sets the default error handler used for all chains created by this factory,
if they do not supply their own error handler.
|
void |
shutdown(int duration,
TimeUnit units)
Shuts down the TaskChain system, forcing all tasks to run on current threads and finish.
|
public TaskChainFactory(GameInterface impl)
public Map<String,Queue<co.aikar.taskchain.SharedTaskChain>> getSharedChains()
public <T> TaskChain<T> newSharedChain(String name)
name
- Name of the shared chain. Case sensitivepublic BiConsumer<Exception,TaskChainTasks.Task<?,?>> getDefaultErrorHandler()
public void setDefaultErrorHandler(BiConsumer<Exception,TaskChainTasks.Task<?,?>> errorHandler)
errorHandler
- The error handlerpublic void shutdown(int duration, TimeUnit units)
duration
- How long in the supplied units to wait before giving up the shutdown.units
- The units for how long to wait before giving up the shutdownCopyright © 2018. All rights reserved.