\Swift_Plugins_AntiFloodPlugin
Reduces network flooding when sending large amounts of mail.
- Author: Chris Corbyn
Synopsis
class Swift_Plugins_AntiFloodPlugin
implements
Swift_Events_SendListener,Swift_Plugins_Sleeper
{
- // members
- private int $_threshold;
- private int $_sleep;
- private integer $_counter;
- private Swift_Plugins_Sleeper $_sleeper;
- // methods
- public void __construct()
- public void setThreshold()
- public int getThreshold()
- public void setSleepTime()
- public int getSleepTime()
- public void beforeSendPerformed()
- public void sendPerformed()
- public void sleep()
Hierarchy
Implements
Members
private
- $_counter
—
int
The internal counter. - $_sleep
—
int
The number of seconds to sleep for during a restart. - $_sleeper
—
Swift_Plugins_Sleeper
The Sleeper instance for sleeping. - $_threshold
—
int
The number of emails to send before restarting Transport.
Methods
public
- __construct() — Create a new AntiFloodPlugin with $threshold and $sleep time.
- beforeSendPerformed() — Invoked immediately before the Message is sent.
- getSleepTime() — Get the number of seconds to sleep for during a restart.
- getThreshold() — Get the number of emails to send before restarting.
- sendPerformed() — Invoked immediately after the Message is sent.
- setSleepTime() — Set the number of seconds to sleep for during a restart.
- setThreshold() — Set the number of emails to send before restarting.
- sleep() — Sleep for $seconds.