I want to add two phase authentication in my website login process, thus I want to send an SMS to my user with random access code, benstalkd can help to asynchronous send the message, and improvement user experience. And you can easy to see, this is a time sensitive process, so it cannot be added into crontab, I want my send process can be notified when a new job put into the queue.
Any idea? Thanks in advanced.
index.php
$di->set('queue', function() use ($config) {
$queue = new Phalcon\Queue\Beanstalk(array(
'host' => $config->queue->host,
'port' => $config->queue->port
));
return $queue;
});