title: code igniter and exec?
body: <p>I have a script that, inserts into the database e.g. 20,000 users with email addresses in batches of 1000</p>
  
  <p>(so two tables, emailParent, emailChild), there are 1000 rows in emailChild for every row in emailParent.</p>
  
  <p>I want to run a script that sends these emails which basically says
  <code>//check_for_pending_parent_rows() returns the id of the first pending row found, or 0</code><br>
  <code>while($parentId = check_for_pending_parent_row()){//loop over children of parent row}</code></p>
  
  <p>Now because this is talking to the sendgrid servers this can take some time.</p>
  
  <p>So I want to be able to hit a page and have that page launch a background process which sends the emails to sendgrid.</p>
  
  <p>I thought I could use <code>exec()</code> but then I realized, I am using code igniter, which means the entry point MUST be <code>index.php</code> hence, I don't think <code>exec()</code> will work,</p>
  
  <p>How can I launch a background process that uses code igniter?</p>