XOOPS RMCommon Utilities
2.1.8.91RC
|
Public Member Functions | |
__construct ($rate, $mode=self::BYTES_PER_MINUTE, Swift_Plugins_Sleeper $sleeper=null, Swift_Plugins_Timer $timer=null) | |
beforeSendPerformed (Swift_Events_SendEvent $evt) | |
getTimestamp () | |
sendPerformed (Swift_Events_SendEvent $evt) | |
sleep ($seconds) | |
Public Member Functions inherited from Swift_Plugins_BandwidthMonitorPlugin | |
beforeSendPerformed (Swift_Events_SendEvent $evt) | |
bind (Swift_InputByteStream $is) | |
commandSent (Swift_Events_CommandEvent $evt) | |
commit () | |
flushBuffers () | |
getBytesIn () | |
getBytesOut () | |
reset () | |
responseReceived (Swift_Events_ResponseEvent $evt) | |
sendPerformed (Swift_Events_SendEvent $evt) | |
unbind (Swift_InputByteStream $is) | |
write ($bytes) | |
Public Attributes | |
const | BYTES_PER_MINUTE = 0x01 |
const | MESSAGES_PER_MINUTE = 0x10 |
Private Member Functions | |
_throttleBytesPerMinute ($timePassed) | |
_throttleMessagesPerMinute ($timePassed) | |
Private Attributes | |
$_messages = 0 | |
$_mode | |
$_rate | |
$_sleeper | |
$_start | |
$_timer | |
Definition at line 22 of file ThrottlerPlugin.php.
Swift_Plugins_ThrottlerPlugin::__construct | ( | $rate, | |
$mode = self::BYTES_PER_MINUTE , |
|||
Swift_Plugins_Sleeper | $sleeper = null , |
||
Swift_Plugins_Timer | $timer = null |
||
) |
Create a new ThrottlerPlugin.
int | $rate | |
int | $mode,defaults | to BYTES_PER_MINUTE |
Swift_Plugins_Sleeper | $sleeper | (only needed in testing) |
Swift_Plugins_Timer | $timer | (only needed in testing) |
Definition at line 83 of file ThrottlerPlugin.php.
|
private |
Get a number of seconds to sleep for.
int | $timePassed |
Definition at line 170 of file ThrottlerPlugin.php.
References Swift_Plugins_BandwidthMonitorPlugin\getBytesOut().
Referenced by beforeSendPerformed().
|
private |
Get a number of seconds to sleep for.
int | $timePassed |
Definition at line 182 of file ThrottlerPlugin.php.
Referenced by beforeSendPerformed().
Swift_Plugins_ThrottlerPlugin::beforeSendPerformed | ( | Swift_Events_SendEvent | $evt | ) |
Invoked immediately before the Message is sent.
Swift_Events_SendEvent | $evt |
Implements Swift_Events_SendListener.
Definition at line 96 of file ThrottlerPlugin.php.
References $_start, _throttleBytesPerMinute(), _throttleMessagesPerMinute(), getTimestamp(), and sleep().
Swift_Plugins_ThrottlerPlugin::getTimestamp | ( | ) |
Get the current UNIX timestamp
Implements Swift_Plugins_Timer.
Definition at line 150 of file ThrottlerPlugin.php.
Referenced by beforeSendPerformed().
Swift_Plugins_ThrottlerPlugin::sendPerformed | ( | Swift_Events_SendEvent | $evt | ) |
Invoked when a Message is sent.
Swift_Events_SendEvent | $evt |
Implements Swift_Events_SendListener.
Definition at line 124 of file ThrottlerPlugin.php.
References $_messages.
Swift_Plugins_ThrottlerPlugin::sleep | ( | $seconds | ) |
Sleep for $seconds.
int | $seconds |
Implements Swift_Plugins_Sleeper.
Definition at line 134 of file ThrottlerPlugin.php.
Referenced by beforeSendPerformed().
|
private |
Definition at line 74 of file ThrottlerPlugin.php.
Referenced by sendPerformed().
|
private |
Definition at line 67 of file ThrottlerPlugin.php.
|
private |
Definition at line 59 of file ThrottlerPlugin.php.
|
private |
Definition at line 38 of file ThrottlerPlugin.php.
|
private |
Definition at line 52 of file ThrottlerPlugin.php.
Referenced by beforeSendPerformed().
|
private |
Definition at line 45 of file ThrottlerPlugin.php.
const Swift_Plugins_ThrottlerPlugin::BYTES_PER_MINUTE = 0x01 |
Flag for throttling in bytes per minute
Definition at line 28 of file ThrottlerPlugin.php.
const Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE = 0x10 |
Flag for throttling in emails per minute
Definition at line 31 of file ThrottlerPlugin.php.