Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Controlling e-mails sent per hour

by z3d (Scribe)
on Feb 06, 2004 at 10:04 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2023-03-24 19:56 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (61 votes). Check out past polls.