Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Controlling e-mails sent per hour

by z3d (Scribe)
on Feb 06, 2004 at 10:04 UTC ( [id://327029]=note: print w/replies, xml ) Need Help??


in reply to Controlling e-mails sent per hour

I'm not a 100% sure that sleep is your best bet in the end though, at least not as is. If for whatever reason there's a slight delay in being able to get those emails out, you could be losing maximum usage of your outbound mail. For instance, if it takes a few seconds to send a batch, sure, that's fine. But what if the mailserver is in a crabby mood that day and it takes a couple extra minutes to send? One off the cuff thought on this is that you could still use sleep, but maybe use a timer function (for some reason using benchmark comes to mind, but I'm sure that's not the most elegant solution) so that you can set your sleep to be a variable interval - maximum per time block minus how long it took to send the last batch, rounded up to an integer. Just a thought - of course, I live in a weird world where things never go as smoothly as I had hoped :)



"I have never written bad code. There are merely unanticipated features."

Replies are listed 'Best First'.
Re: Re: Controlling e-mails sent per hour
by z3d (Scribe) on Feb 06, 2004 at 15:07 UTC
    somehow I missed rob_au's post before mine (time - yeah, need more coffee or something). sorry about the double post

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://327029]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-19 14:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found