<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 2:04 PM, Andrew <span dir="ltr">&lt;<a href="mailto:catalystgroup@unitedgames.co.uk" target="_blank">catalystgroup@unitedgames.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>





<div bgcolor="#ffffff">
<div><font size="2"></font> </div>
<blockquote style="PADDING-RIGHT:0px;PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:#000000 2px solid;MARGIN-RIGHT:0px">
  <div dir="ltr">
  <div class="gmail_extra">
  <div class="gmail_quote"><span class="">
  <div>If you&#39;re handing off the mail to exim, you&#39;re fine.  Your 
  implementation is correct for your use case</div>
  <div><font size="2"></font> </div>
  </span><div><font size="2">---&gt; Of course, I&#39;m guessing I&#39;m handing off to exim - I 
  should probably do something to check!</font></div></div></div></div></blockquote></div></blockquote><div>Look for Email::Sender configuration.  It probably defaults to sendmail, which is what you want.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#ffffff"><blockquote style="PADDING-RIGHT:0px;PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:#000000 2px solid;MARGIN-RIGHT:0px"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">
  <div><font size="2"></font><font size="2"></font><font size="2"></font><font size="2"></font><font size="2"></font><font size="2"></font><font size="2"></font><font size="2"></font><font size="2"></font><font size="2"></font><br></div>
  <div>if the sign up for your service,</div>
  <div>queue a &quot;send them a welcome email&quot; job,</div>
  <div>and let the web request request return.</div>
  <div> </div>
  <div>Then a separate process:</div>
  <div>sees that an email needs to be sent,</div>
  </span><div>generates the email,</div><span class="">
  <div>and hands it off to exim.</div><font size="2"></font><font size="2"></font><font size="2"></font><font size="2"></font><font size="2"></font></span></div>
  <div class="gmail_quote"> </div>
  <div class="gmail_quote"><font size="2">----&gt; So what does the separate process 
  have to be? A process apart from my Catalyst app - like an entirely different 
  perl script that could be a cron job or something - or can I return a response 
  to the browser within my catalyst subroutine, and then call a private 
  catalyst subroutine to handle the email sending?</font></div></div></div></blockquote></div></blockquote><div>What triggers the sending of the 3000? </div><div><br></div><div>I use a table as a queue, and I write a program that loops over the queue until no more work to do:<br></div><div><ol><li> read the least-recently-processed job from the queue that has work to do</li><ol><li>determine work-to-do as unassigned.  (PID is null)</li></ol><li>mark it as assigned </li><ol><li>i keep a pid column and update the pid into the record</li></ol><li>do the work</li><ol><li>the whole job of some slice</li></ol><li>if done, </li><ol><li>perform post job bookkeeping</li></ol><li>else</li><ol><li>update in-progress status (num_complete)</li><li>update PID = NULL</li><ol><li>so the job processor can come back too it.</li></ol></ol></ol><div><br></div></div><div>I use this algorithm to send 500 emails at a time (in RoR). After 500, the job goes to the end of the queue, and the next job is processed. </div><div><br></div><div>My processor is a stand-alone script that is run from cron.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#ffffff"><blockquote style="PADDING-RIGHT:0px;PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:#000000 2px solid;MARGIN-RIGHT:0px"><div dir="ltr"><div class="gmail_extra">
  <div class="gmail_quote">
  <div><font size="2"></font><font size="2"></font><br><font size="2">---&gt; And yes, 
  after the quick fix, it wouldn&#39;t hurt to debug and see if there are memory 
  issues.</font></div></div></div></div></blockquote></div></blockquote><div>That&#39;s the fun part. </div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#ffffff"><blockquote style="PADDING-RIGHT:0px;PADDING-LEFT:5px;MARGIN-LEFT:5px;BORDER-LEFT:#000000 2px solid;MARGIN-RIGHT:0px"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><font size="2"> </font></div></div></div></div></blockquote></div>
<br>_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" rel="noreferrer" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" rel="noreferrer" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" rel="noreferrer" target="_blank">http://dev.catalyst.perl.org/</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Len Jaffe - Information Technology Smoke Jumper - <a href="mailto:lenjaffe@jaffesystems.com" target="_blank">lenjaffe@jaffesystems.com</a> </div><div>614-404-4214    <a href="https://www.twitter.com/lenJaffe" target="_blank">@LenJaffe</a>  <a href="http://www.lenjaffe.com/" target="_blank">www.lenjaffe.com</a><br></div><div>Host of <a href="http://www.meetup.com/techlifecolumbus/" target="_blank">Code Jam Columbus</a>  - <a href="https://www.twitter.com/CodeJamCMH" target="_blank">@CodeJamCMH</a></div><div><div>Curator of <a href="http://www.lenjaffe.com/AdventPlanet/" target="_blank">Advent Planet</a> - An Aggregation of Online Advent Calendars.<div><br></div></div></div></div></div></div></div></div></div>
</div></div>