Swift Connection Rotator

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
hdogg
Forum Newbie
Posts: 13
Joined: Fri Apr 06, 2007 10:39 am

Swift Connection Rotator

Post by hdogg »

I use swift to send 1 email per batch with 6 connections to rotate between. Each time a page is called one email is sent.

Conceptually, how does this effect the rotator? If at all?

Also...

Say Connection 1 reaches the hourly limit and sends unsuccessfully....

Will Connection 1 always be called for the remainder of the hour?

And is there a EmailSuccess variable to know for SURE that it has gone through?

Also...

What's the harm in never calling the disconnect()?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Swift Connection Rotator

Post by Chris Corbyn »

The rotator works on a per-request basis. PHP is stateless so when the page request has ended Swift doesn't know anything about previous requests. From your wording it seems you may have misunderstood what the rotator connection does...

If in a single page request you send 3 emails then the rotator will rotate 3 times. If you send 1 email using 3 separate page requests the rotator will just be at the first connection each time.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Swift Connection Rotator

Post by alex.barylski »

Connection rotation. That genius.

Might I ask: Does this actually improve performance of a bulk email sending engine? Say if I had several SMTP accounts, like GMail, my ISP * 3, etc and I rotated those connections.
If in a single page request you send 3 emails then the rotator will rotate 3 times. If you send 1 email using 3 separate page requests the rotator will just be at the first connection each time.
Hmmm...is there any way to parition that? Meaning, send the first 1000 emails with connection one, then switch to 2 for the next 1000, etc?

It just seems that iterating through a list of connections like that would be expensive, no? I assume caching is employed to prevent much performance loss.

Very cool idea though...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Swift Connection Rotator

Post by Chris Corbyn »

Hockey wrote:Connection rotation. That genius.

Might I ask: Does this actually improve performance of a bulk email sending engine? Say if I had several SMTP accounts, like GMail, my ISP * 3, etc and I rotated those connections.
Not speed if compared wit using the AntiFlood plugin (or at least neglible), but load, yes.
Hockey wrote:
If in a single page request you send 3 emails then the rotator will rotate 3 times. If you send 1 email using 3 separate page requests the rotator will just be at the first connection each time.
Hmmm...is there any way to parition that? Meaning, send the first 1000 emails with connection one, then switch to 2 for the next 1000, etc?

It just seems that iterating through a list of connections like that would be expensive, no? I assume caching is employed to prevent much performance loss.

Very cool idea though...
You can specify a threshold before the rotation occurs yes, and once a connection is established it is maintained until disconnect() is called on the rotator.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Swift Connection Rotator

Post by alex.barylski »

First there was C, then came C shell, around that same time frame I assume C++ and in the new millenium came C# (which I initially thought was pronounced C pound)...

Now we have a C^2 -- thats you (^2 = Squared or CC).

Software is always better when its powered by two. :P

I will certainly keep that rotator in mind as I re-implement my script in the next coming weeks. sweet. 8)
everisk
Forum Newbie
Posts: 11
Joined: Sat Mar 21, 2009 9:32 am

Re: Swift Connection Rotator

Post by everisk »

Chris Corbyn wrote:You can specify a threshold before the rotation occurs yes, and once a connection is established it is maintained until disconnect() is called on the rotator.
How do I specify this threshold?? I'd really like to use it.

Another irrelevant question, does connection rotator works with antiflood and throttler plug-in? How?

Thanks!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Swift Connection Rotator

Post by Chris Corbyn »

everisk wrote:
Chris Corbyn wrote:You can specify a threshold before the rotation occurs yes, and once a connection is established it is maintained until disconnect() is called on the rotator.
How do I specify this threshold?? I'd really like to use it.
I got my facts mxied up. You actually can't :oops:

I'm going to add this feature.
Another irrelevant question, does connection rotator works with antiflood and throttler plug-in? How?
Yes it does. You just register all 3 plugins and it will "just work" :)
everisk
Forum Newbie
Posts: 11
Joined: Sat Mar 21, 2009 9:32 am

Re: Swift Connection Rotator

Post by everisk »

:lol: no problem..i'll just wait for it to be added then
Post Reply