Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Run Async Task in background

https://docs.phalconphp.com/en/latest/reference/cli.html

as in example $ php app/cli.php main test world universe

is there a "phalcon way" to execute a task as a background job from Controller? or to use

    shell_exec('php app/cli.php main test world universe')


5.9k
Accepted
answer

Queuing is probably the closest to what you're after. Currently only Beanstalk is supported (which runs as a daemon).

https://docs.phalconphp.com/en/latest/reference/queue.html

Your controller would put a job in the queue, and the workers that you have running separately would process them when received.

Yea, i would definitely use beanstalkd queue too.

What is best beanstlkd lib that I could create something like https://laravel.com/docs/5.1/queues#running-the-queue-listener

What you mean ? Phalcon already has stuff like this, just mix phalcon cli and queue.

https://docs.phalconphp.com/pl/latest/reference/cli.html