* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class IdleLoopTask extends BaseTask implements Taskable, Visitable {
+ /**
+ * Idle loop time
+ */
+ private $idleTime = 0;
+
/**
* Protected constructor
*
protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
+
+ // Init idle loop time from config ("cache" it here)
+ $this->idleLoop = $this->getConfigInstance()->getConfigEntry('idle_loop_time');
}
/**
* @return void
*/
public function executeTask () {
- // Idle here a little (2 milliseconds)
- $this->idle(2);
+ // Idle here a little
+ $this->idle($this->idleLoopTime);
}
/**
// CFG: TASK-IDLE-LOOP-MAX-RUNS
$cfg->setConfigEntry('task_idle_loop_max_runs', 0);
+// CFG: IDLE-LOOP-TIME (5 milli seconds)
+$cfg->setConfigEntry('idle_loop_time', 5);
+
// CFG: SHUTDOWN-TASK-VISITOR-CLASS
$cfg->setConfigEntry('shutdown_task_visitor_class', 'ShutdownTaskVisitor');