Codeigniter or PHP Queue (queue)

1

I'm doing a massive upload of files to a photo server.

It happens that until you send all the photos, the user ends up waiting a long time. Then they gave me the hint of searching about queue or queue. This way, the user could leave the upload page and do other things on the system, while behind PHP would send it.

No Codeigniter, I did not find anything about it. Does anyone know how to do via PHP or Codeigniter a task queue?

    
asked by anonymous 19.03.2018 / 18:43

1 answer

0

Personal in Laravel there is a cron function that works backstage, as if it were the cronjob of linux.

I did not find this in CodeIgniter , what I did was pretty simple:

1- I created a cronjobs table; 2- When uparing the photos to the system, the same saves in cronjobs a task that is to launch to the other server gradually; 3- Sete a cronjob that hits from time to time in this script, which analyzes the pending cronjobs and sends it.

The business has become so cool that I'm using it for a variety of other functions, where the user does not have to wait (example of sending simple emails through the system, generating heavier reports, etc.).

    
01.05.2018 / 16:16