Tripal
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TripalDaemon Class Reference
Inheritance diagram for TripalDaemon:
Inheritance graph
[legend]
Collaboration diagram for TripalDaemon:
Collaboration graph
[legend]

Public Member Functions

 setParallel ($do_parallel, $max_num_jobs)
 

Protected Member Functions

 executeTask ($iteration_number)
 
 getTripalJobID ()
 
 runTripalJob ($job_id)
 
 runParallelTripalJob ($job_id)
 
 runSequentialTripalJob ($job)
 
 checkJobStatus ($job_id=FALSE)
 
 getStatusDetails ()
 

Protected Attributes

 $loop_interval = 20
 
 $tripal_jobs = []
 
 $queue = []
 
 $do_parallel = FALSE
 
 $max_num_jobs = 3
 

Detailed Description

This is the main class for the Tripal Daemon.

It extends the DaemonAPIDaemon class provided by the Daemon API in order to implement tripal job checking and execution functionality.

Member Function Documentation

◆ checkJobStatus()

TripalDaemon::checkJobStatus (   $job_id = FALSE)
protected

Check the status of a given (or all running) jobs.

Parameters
$job_idThe job_id of a specific job to check the status us. (OPTIONAL)

◆ executeTask()

TripalDaemon::executeTask (   $iteration_number)
protected

Implements DaemonAPIDaemon::executeTask() function.

This gets executed once per loop iteration & does the following:

  1. Checks to see if there are any Tripal Jobs waiting to be executed.
  2. If there are then they are run (jobs with a higher priority and higher job_id are run first.

This function will log how many jobs have been found and when each one was started/completed, as well as, it's status upon completion.

Parameters
int$iteration_numberThis is an integer stating the current iteration of the loop you are on.

◆ getStatusDetails()

TripalDaemon::getStatusDetails ( )
protected

Override to include additional daemon-specific settings for use in reports.

Returns
array An array of status details where the key should be a human-readable name for your detail and the value should be the current state.

◆ getTripalJobID()

TripalDaemon::getTripalJobID ( )
protected

Get job_id of Tripal Job to run.

NOTE: This function should only return a job_id if we are aloud to run it.

◆ runParallelTripalJob()

TripalDaemon::runParallelTripalJob (   $job_id)
protected

Run Parallel Tripal Job.

◆ runSequentialTripalJob()

TripalDaemon::runSequentialTripalJob (   $job)
protected

Run Sequential Tripal Job.

◆ runTripalJob()

TripalDaemon::runTripalJob (   $job_id)
protected

Run Tripal Job.

◆ setParallel()

TripalDaemon::setParallel (   $do_parallel,
  $max_num_jobs 
)

Set whether we should run parallel jobs or not.

Parameters
$do_parallelBoolean indicating whether to allow parallel processing of jobs.
$max_num_jobsInteger indicating the maximum number of jobs to run at once.

The documentation for this class was generated from the following file: