Tasks

Tasks

addResult()

Adds a task result to the application

Arguments

NameTypeRequiredDefaultOptionsDescription
taskIDstringNo
jobTypestringNo
jobIDstringNo
ownedBystringNo
resultstructYes

addTask()

Adds a task to the processing queue.

Arguments

NameTypeRequiredDefaultOptionsDescription
taskIDstringNo#application.fapi.getUUID()#
jobTypestringNo
jobIDstringNo
actionstringYes
detailsanyYes
ownedBystringNo
stacktracearrayNo#arraynew(1)#

claimTask()

Removes the first task in the queue and returns it

Arguments

NameTypeRequiredDefaultOptionsDescription
threadIDstringYes

clearProcessingThreads()

Terminates threads that haven't done work in a while

Arguments

clearTaskResults()

Removes results that are too old from the queue

Arguments

NameTypeRequiredDefaultOptionsDescription
None
NameTypeRequiredDefaultOptionsDescription
jobIDuuidNo
beforenumericNo#getTickCount() - application.config.taskqueue.resultTimeout * 60000#

endJob()

Remotes all tasks and results for a job, and stops any thread running one of it's tasks

Arguments

NameTypeRequiredDefaultOptionsDescription
jobIDuuidYes

getJobs()

Returns all jobs that have results logged

Arguments

getResults()

Removes and returns matching results

Arguments

NameTypeRequiredDefaultOptionsDescription
None
NameTypeRequiredDefaultOptionsDescription
taskIDstringNo
jobIDstringNo
ownedBystringNo
previousTicknumericNo
clearResultsbooleanNotrue

getTaskCount()

Returns the number of tasks remaining for the given criteria

Arguments

NameTypeRequiredDefaultOptionsDescription
taskIDstringNo
jobIDstringNo
ownedBystringNo

getThreadCount()

Returns number of threads

Arguments

init()

Arguments

NameTypeRequiredDefaultOptionsDescription
None

killThread()

Terminates a specified thread

Arguments

NameTypeRequiredDefaultOptionsDescription
None
NameTypeRequiredDefaultOptionsDescription
threadIDstringYes
requeueTaskbooleanNotrue

processTask()

Actually process the task

Arguments

NameTypeRequiredDefaultOptionsDescription
stTaskstructYes

removeTask()

Removes a task from the processing queue, and returns it's details

Arguments

NameTypeRequiredDefaultOptionsDescription
taskIDstringYes

requeueTask()

Requeues a task

Arguments

NameTypeRequiredDefaultOptionsDescription
taskIDstringYes

resetTasks()

Remotes all tasks and results for a job, and stops any thread running one of it's tasks

Arguments

NameTypeRequiredDefaultOptionsDescription
jobIDuuidYes

startProcessingThread()

If the thread limit hasn't been reached, this starts a new one

Arguments

NameTypeRequiredDefaultOptionsDescription
None