ok..tried that with no success:
(cli.php)
include...
// Connect to Beanstalk
$queue = new Phalcon\Queue\Beanstalk(
array(
'host' => '127.0.0.1',
'port' => '11300'
)
);
$queue->choose('mainHook');
while($job = $queue->reserve()) {
$arguments = array();
$reception = $job->getBody();
foreach ($reception as $k => $arg) {
if ($k == 1) {
$arguments['task'] = $reception['task'];
} elseif ($k == 2) {
$arguments['action'] = $reception['action'];
} elseif ($k >= 3) {
$arguments[] = $reception['data'];
}
}
try {
$app = new ConsoleApp();
$app->setDI($di);
$app->handle($arguments);
} catch (Exception $e) {
echo $e->getMessage();
}
$job->delete();
}
and in the web app:
// Connect to the queue
$queue = new Phalcon\Queue\Beanstalk(
array(
'host' => '127.0.0.1',
'port' => '11300'
)
);
$queue->choose('mainHook');
$job = array(
"task" => "logging",
"action" => "start"
);
$queue->put($job);
..and I'm not sure about how to start the cli app first, when an user log into