Class Swift_Plugins_ThrottlerPlugin
Throttles the rate at which emails are sent.
Public Methods
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
BYTES_PER_MINUTE | 1 | Flag for throttling in bytes per minute | Swift_Plugins_ThrottlerPlugin |
MESSAGES_PER_MINUTE | 16 | Flag for throttling in emails per minute | Swift_Plugins_ThrottlerPlugin |
MESSAGES_PER_SECOND | 17 | Flag for throttling in emails per second (Amazon SES) | Swift_Plugins_ThrottlerPlugin |
Method Details
Create a new ThrottlerPlugin.
public void __construct ( $rate, $mode = self::BYTES_PER_MINUTE, Swift_Plugins_Sleeper $sleeper = null, Swift_Plugins_Timer $timer = null ) | ||
$rate | int | |
$mode | ||
$sleeper | Swift_Plugins_Sleeper | (only needed in testing) |
$timer | Swift_Plugins_Timer | (only needed in testing) |
Invoked immediately before the Message is sent.
public void beforeSendPerformed ( Swift_Events_SendEvent $evt ) | ||
$evt | Swift_Events_SendEvent |
Get the current UNIX timestamp.
public int getTimestamp ( ) |
Invoked when a Message is sent.
public void sendPerformed ( Swift_Events_SendEvent $evt ) | ||
$evt | Swift_Events_SendEvent |
Sleep for $seconds.
public void sleep ( $seconds ) | ||
$seconds | int |