Class AsyncJobManager
java.lang.Object
com.kingsrook.qqq.backend.core.actions.async.AsyncJobManager
Class to manage running asynchronous actions, and working with their statuses.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Getter for forcedJobUUIDgetJobStatus
(String uuid) Get the status of the job identified by the given UUID.void
setForcedJobUUID
(String forcedJobUUID) Setter for forcedJobUUID<T extends Serializable>
TStart a job - if it finishes within the specified timeout, get its results, else, get back an exception with the job id.<T extends Serializable>
StringStart a job, and always, just get back the job UUID.<T extends Serializable>
TStart a job - if it finishes within the specified timeout, get its results, else, get back an exception with the job id.<T extends Serializable>
StringStart a job, and always, just get back the job UUID.withForcedJobUUID
(String forcedJobUUID) Fluent setter for forcedJobUUID
-
Constructor Details
-
AsyncJobManager
public AsyncJobManager()
-
-
Method Details
-
startJob
public <T extends Serializable> T startJob(long timeout, TimeUnit timeUnit, AsyncJob<T> asyncJob) throws JobGoingAsyncException, QException Start a job - if it finishes within the specified timeout, get its results, else, get back an exception with the job id.- Throws:
JobGoingAsyncException
QException
-
startJob
public <T extends Serializable> T startJob(String jobName, long timeout, TimeUnit timeUnit, AsyncJob<T> asyncJob) throws JobGoingAsyncException, QException Start a job - if it finishes within the specified timeout, get its results, else, get back an exception with the job id.- Throws:
JobGoingAsyncException
QException
-
startJob
Start a job, and always, just get back the job UUID.- Throws:
QException
-
startJob
public <T extends Serializable> String startJob(String jobName, AsyncJob<T> asyncJob) throws QException Start a job, and always, just get back the job UUID.- Throws:
QException
-
getJobStatus
Get the status of the job identified by the given UUID. -
cancelJob
-
getForcedJobUUID
Getter for forcedJobUUID -
setForcedJobUUID
Setter for forcedJobUUID -
withForcedJobUUID
Fluent setter for forcedJobUUID
-