ZendJobQueue Functions - createCliJob

General discussion forum for the Zend Server
Post Reply
Posts: 1
Joined: Fri Sep 07, 2018 8:08 am

ZendJobQueue Functions - createCliJob

Post by Gianluca » Fri Sep 07, 2018 8:53 am

I've zend server 9.2 and i'm trying to use the function createCliJob.
In according with documentation found in
http://files.zend.com/help/Zend-Server/ ... eateCliJob
i'm using the following sample code:

$queue = new \ZendJobQueue();
$jobId = $queue->createCliJob(
"key1" => $param1,
"key2" => $param2,
"key3" => $param3
"name" => "sampleCliJob",
"persistent" => true,
"job_timeout" => 5,
"queue_name" => "sample_queue"

running this code i obtain the following ArgumentCountError error:

"ZendJobQueue::createCliJob() expects at most 2 parameters, 3 given"

User avatar
Zend Global Support
Posts: 997
Joined: Sun Dec 14, 2008 9:48 am

Re: ZendJobQueue Functions - createCliJob

Post by zvika » Thu Sep 20, 2018 12:40 pm

Thanks for the report
We provide 2 CLI job types, one is a classic PHP job which works like an HTTP job, only with a script path instead of a URL,
and the other is a generic CLI job, which accepts only 2 params:
command (with / without inline parameters)
options (name, priority, timeout etc.)
We will update the documentation in a few days.
Zvika Dror
Zend Support Team

Post Reply