$data, 'time' => date('Y-m-d H:i:s'), 'doName' => $name]; $isPushed = Queue::push($jobHandlerClassName, $jobData, $jobQueueName); } else { $jobData = ['pinkInfo' => $data, 'time' => date('Y-m-d H:i:s')]; if (!isset($data['pink_time']) || !$data['pink_time']) return true; $timewait = $data['pink_time'] + 300; //$jobData = [ 'pinkInfo' => 'hahah', 'time' => date('Y-m-d H:i:s'), 'b' => 21] ; //$timewait = 20; // 4.将该任务推送到消息队列,等待对应的消费者去执行 $isPushed = Queue::later($timewait, $jobHandlerClassName, $jobData, $jobQueueName); //$isPushed = Queue::push($jobHandlerClassName , $jobData , $jobQueueName ); // database 驱动时,返回值为 1|false ; redis 驱动时,返回值为 随机字符串|false } if ($isPushed !== false) { return 1; } else { return 1; } } catch (ErrorException $e) { echo $e->getMessage(); } } }