示例#1
0
 public function testGetData_serializesClosure()
 {
     $testClosure = function () {
         $this->fail('should never be executed');
     };
     $expectedData = (new Serializer())->serialize($testClosure);
     $command = new ClosureCommand();
     $command->setClosure($testClosure);
     $data = $command->getData();
     $this->assertEquals($expectedData, $data);
 }
示例#2
0
文件: QMan.php 项目: zwilias/qman
 public function queueClosure(\Closure $closure, $tube = Beanie::DEFAULT_TUBE, $priority = Beanie::DEFAULT_PRIORITY, $delay = Beanie::DEFAULT_DELAY, $timeToRun = Beanie::DEFAULT_TIME_TO_RUN)
 {
     $closureCommand = new ClosureCommand();
     $closureCommand->setClosure($closure);
     $this->queue($closureCommand, $tube, $priority, $delay, $timeToRun);
 }