If you need quite amount of time to process the data, you should consider to create a queue job using beanstalk. Phalcon implements beanstalk client since ver 1.1.0.
Check https://docs.phalcon.io/en/latest/reference/queue.html.
Below is the skeleton for the worker tasks for processing your data.
<?php
namespace BI\Console\Tasks;
class WorkerBase extends TaskBase
{
protected $_tube = 'default';
protected $_name = null;
protected function process($data,&$error){
//process your xml data here
var_dump($data);
}
public function mainAction($arg)
{
$q = $this->BeanstalkQueue;
while (true) {
$q->watch($this->_tube);
$job = @$q->reserve();
$data = $job->getBody();
$processResult = $this->process($data, $error);
$job->delete();
}
}
}
}
?>