/** * This function creates a bucket for each job in fork daemon so it is * easier to manage if it should run or not. * * @param string $class Job to create buckets for. * @return void */ private function createJobBuckets($class) { $job = $this->getJob($class); $this->fork_daemon->add_bucket($class); $this->fork_daemon->max_children_set(1, $class); $this->fork_daemon->register_child_run(array($this, 'processWork'), $class); $this->fork_daemon->register_parent_child_exit(array($this, 'parentChildExit'), $class); $this->fork_daemon->child_max_run_time_set($job->getMaxRunTime(), $class); }