예제 #1
0
 /**
  * @covers Gloubster\Message\Job\AbstractJob::setResult
  * @covers Gloubster\Message\Job\AbstractJob::getResult
  */
 public function testGetSetResult()
 {
     $result = array('sha245' => '65647576890abc');
     $this->object->setResult($result);
     $this->assertEquals($result, $this->object->getResult());
     $data = json_decode($this->object->toJson(), true);
     $this->assertEquals($result, $data['result']);
 }
예제 #2
0
 /**
  * @param JobInterface $job
  * @param string       $jobType
  * @param string       $connector
  *
  * @throws DuplicatedJobException
  */
 public function register(JobInterface $job, $jobType, $connector)
 {
     if (isset($this->jobs[$job->getName()])) {
         throw new DuplicatedJobException(sprintf('The job "%s" is already registered', $job->getName()));
     }
     $this->jobs[$job->getName()] = $job;
     $this->jobsByType[$jobType][$job->getName()] = $job;
     $this->jobsByTypeGroupByConnector[$jobType][$connector][$job->getName()] = $job;
     $this->jobsByConnector[$connector][$job->getName()] = $job;
 }
예제 #3
0
파일: Job.php 프로젝트: rezzza/jobflow
 /**
  * @param JobInterface $child
  */
 public function add(JobInterface $child)
 {
     $child->setParent($this);
     $this->children[$child->getName()] = $child;
 }
예제 #4
0
 public function create(JobInterface $job, $input, $current, Metadata $metadata = null)
 {
     return new JobContext($job->getName(), $input, $current, $job->getContextOption(), $job->getOptions(), $metadata);
 }