How do I make my worker ask for more time to work on the job ?
I am using the pheanstalk library. Work is a parsing of a file which depending on the file may take more than 60 secs, the default ttr.
while( $job = $pheanstalk->watch($tubeName)->reserve() ){
// get the job body
$parserExec = unserialize( $job->getData() );
// execute parser - will take more than 1 min most of the time
exec( $parserExec['command'] );
// rest of the stuff - delete job etc
}
I am new to queue stuff and I have been going through the examples I found online. If I am doing this wrong, please do tell. I tried to get the jobstats and write a conditional based on the time-left value but I could not get it to work. When I use the jobStats function in pheanstalk the result is a private object array. What I want is to have the script wait till the exec is complete however long that may take.