PHP Classes

Using cron jobs to as backend scripts

Recommend this page to a friend!

      Asynchronous Long Server Tasks  >  Asynchronous Long Server Tasks package blog  >  Starting Long Server ...  >  All threads  >  Using cron jobs to as backend scripts  >  (Un) Subscribe thread alerts  
Subject:Using cron jobs to as backend scripts
Summary:Queue external api calls
Messages:1
Author:Anthony Amolochitis
Date:2015-09-22 12:41:08
 

  1. Using cron jobs to as backend scripts   Reply   Report abuse  
Picture of Anthony Amolochitis Anthony Amolochitis - 2015-09-22 12:41:08
I use queueing as well for external api calls. For instance, I use mailgun to deliver emails, but I do not make the api call to mailgun during page execution. Mailgun calls are made via curl. Imagine what a traffic spike and curl use will do to the server. So to remedy the situation, I store the request in queue, and have another script via cron job pick up the requests and execute them one at a time. This helped improve performance dramatically when I get server traffic spikes.