TYPO3  7.6
Public Member Functions | Private Attributes | List of all members
Swift_Plugins_AntiFloodPlugin Class Reference
Inheritance diagram for Swift_Plugins_AntiFloodPlugin:
Swift_Events_SendListener Swift_Plugins_Sleeper Swift_Events_EventListener

Public Member Functions

 __construct ($threshold=99, $sleep=0, Swift_Plugins_Sleeper $sleeper=null)
 
 setThreshold ($threshold)
 
 getThreshold ()
 
 setSleepTime ($sleep)
 
 getSleepTime ()
 
 beforeSendPerformed (Swift_Events_SendEvent $evt)
 
 sendPerformed (Swift_Events_SendEvent $evt)
 
 sleep ($seconds)
 

Private Attributes

 $_threshold
 
 $_sleep
 
 $_counter = 0
 
 $_sleeper
 

Detailed Description

Reduces network flooding when sending large amounts of mail.

Author
Chris Corbyn

Definition at line 16 of file AntiFloodPlugin.php.

Constructor & Destructor Documentation

__construct (   $threshold = 99,
  $sleep = 0,
Swift_Plugins_Sleeper  $sleeper = null 
)

Create a new AntiFloodPlugin with $threshold and $sleep time.

Parameters
int$threshold
int$sleeptime
Swift_Plugins_Sleeper$sleeper(not needed really)

Definition at line 53 of file AntiFloodPlugin.php.

References setSleepTime(), and setThreshold().

Member Function Documentation

beforeSendPerformed ( Swift_Events_SendEvent  $evt)

Invoked immediately before the Message is sent.

Parameters
Swift_Events_SendEvent$evt

Implements Swift_Events_SendListener.

Definition at line 105 of file AntiFloodPlugin.php.

getSleepTime ( )

Get the number of seconds to sleep for during a restart.

Returns
int

Definition at line 95 of file AntiFloodPlugin.php.

References $_sleep.

getThreshold ( )

Get the number of emails to send before restarting.

Returns
int

Definition at line 75 of file AntiFloodPlugin.php.

References $_threshold.

sendPerformed ( Swift_Events_SendEvent  $evt)

Invoked immediately after the Message is sent.

Parameters
Swift_Events_SendEvent$evt

Implements Swift_Events_SendListener.

Definition at line 114 of file AntiFloodPlugin.php.

References $_counter, Swift_Events_SendEvent\getTransport(), and sleep().

setSleepTime (   $sleep)

Set the number of seconds to sleep for during a restart.

Parameters
int$sleeptime

Definition at line 85 of file AntiFloodPlugin.php.

Referenced by __construct().

setThreshold (   $threshold)

Set the number of emails to send before restarting.

Parameters
int$threshold

Definition at line 65 of file AntiFloodPlugin.php.

Referenced by __construct().

sleep (   $seconds)

Sleep for $seconds.

Parameters
int$seconds

Implements Swift_Plugins_Sleeper.

Definition at line 133 of file AntiFloodPlugin.php.

Referenced by sendPerformed().

Member Data Documentation

$_counter = 0
private

Definition at line 37 of file AntiFloodPlugin.php.

Referenced by sendPerformed().

$_sleep
private

Definition at line 30 of file AntiFloodPlugin.php.

Referenced by getSleepTime().

$_sleeper
private

Definition at line 44 of file AntiFloodPlugin.php.

$_threshold
private

Definition at line 23 of file AntiFloodPlugin.php.

Referenced by getThreshold().