Attempting to use the Redis backed PHP-Resque project https://github.com/chrisboulton/php-resque from within a ZF2 project. (Apigility to be specific)
What I'm having trouble with, is combining the ZF2 namespaces and the classes
for instance :
Controller
//Enqueue a worker
$args = array(
'name' => 'EMCP'
);
Resque::enqueue('default', 'phpresque\\V1\\Model\\MyResqueJob', $args);
MyResqueJob Class
namespace phpresque\V1\Model;
class MyResqueJob
{
public function perform()
{
// Work work work
echo "helloWorld";
}
}
Error message given by resque :
ubuntu@/zf2projectname/vendor/chrisboulton/php-resque$ QUEUE=* APP_INCLUDE=/zf2projectname/vendor/autoload.php VVERBOSE=1 php resque.php
** [03:01:37 2014-10-26] Sleeping for 5
** [03:01:42 2014-10-26] Checking default
** [03:01:42 2014-10-26] Found job on default
** [03:01:42 2014-10-26] got (Job{default} | ID: 38fa104b11de81731c15ba9c2f1853ab | phpresque\V1\Model\MyResqueJob | [{"name":"EMCP"}])
** [03:01:42 2014-10-26] Forked 30642 at 2014-10-26 03:01:42
** [03:01:42 2014-10-26] Processing default since 2014-10-26 03:01:42
** [03:01:42 2014-10-26] (Job{default} | ID: 38fa104b11de81731c15ba9c2f1853ab | phpresque\V1\Model\MyResqueJob | [{"name":"EMCP"}]) failed: Could not find job class phpresque\V1\Model\MyResqueJob.
** [03:01:42 2014-10-26] Checking default