Page 1 of 1

ZendJobQueue Functions - createCliJob

Posted: Fri Sep 07, 2018 8:53 am
by Gianluca
I've zend server 9.2 and i'm trying to use the function createCliJob.
In according with documentation found in ... 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"

Re: ZendJobQueue Functions - createCliJob

Posted: Thu Sep 20, 2018 12:40 pm
by zvika
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.