Documentation

Swift_Plugins_ThrottlerPlugin extends Swift_Plugins_BandwidthMonitorPlugin
in package
implements Swift_Plugins_Sleeper, Swift_Plugins_Timer

Throttles the rate at which emails are sent.

Tags
author

Chris Corbyn

Interfaces, Classes and Traits

Swift_Plugins_Sleeper
Sleeps for a duration of time.
Swift_Plugins_Timer
Provides timestamp data.

Table of Contents

BYTES_PER_MINUTE  = 0x1
Flag for throttling in bytes per minute
MESSAGES_PER_MINUTE  = 0x10
Flag for throttling in emails per minute
MESSAGES_PER_SECOND  = 0x11
Flag for throttling in emails per second (Amazon SES)
$in  : int
The incoming traffic counter.
$messages  : int
An internal counter of the number of messages sent.
$mirrors  : mixed
Bound byte streams
$mode  : int
The mode for throttling.
$out  : int
The outgoing traffic counter.
$rate  : int
The rate at which messages should be sent.
$sleeper  : Swift_Plugins_Sleeper
The Sleeper instance for sleeping.
$start  : int
The time at which the first email was sent.
$timer  : Swift_Plugins_Timer
The Timer instance which provides the timestamp.
__construct()  : mixed
Create a new ThrottlerPlugin.
beforeSendPerformed()  : mixed
Invoked immediately before the Message is sent.
bind()  : mixed
Attach $is to this stream.
commandSent()  : mixed
Invoked immediately following a command being sent.
commit()  : mixed
Not used.
flushBuffers()  : mixed
Not used.
getBytesIn()  : int
Get the total number of bytes received from the server.
getBytesOut()  : int
Get the total number of bytes sent to the server.
getTimestamp()  : int
Get the current UNIX timestamp.
reset()  : mixed
Reset the internal counters to zero.
responseReceived()  : mixed
Invoked immediately following a response coming back.
sendPerformed()  : mixed
Invoked when a Message is sent.
sleep()  : mixed
Sleep for $seconds.
unbind()  : mixed
Remove an already bound stream.
write()  : int
Called when a message is sent so that the outgoing counter can be increased.
throttleBytesPerMinute()  : int
Get a number of seconds to sleep for.
throttleMessagesPerMinute()  : int
Get a number of seconds to sleep for.
throttleMessagesPerSecond()  : int
Get a number of seconds to sleep for.

Constants

BYTES_PER_MINUTE

Flag for throttling in bytes per minute

public mixed BYTES_PER_MINUTE = 0x1

MESSAGES_PER_MINUTE

Flag for throttling in emails per minute

public mixed MESSAGES_PER_MINUTE = 0x10

MESSAGES_PER_SECOND

Flag for throttling in emails per second (Amazon SES)

public mixed MESSAGES_PER_SECOND = 0x11

Properties

$messages

An internal counter of the number of messages sent.

private int $messages = 0

$start

The time at which the first email was sent.

private int $start

Methods

getBytesIn()

Get the total number of bytes received from the server.

public getBytesIn() : int
Return values
int

getBytesOut()

Get the total number of bytes sent to the server.

public getBytesOut() : int
Return values
int

getTimestamp()

Get the current UNIX timestamp.

public getTimestamp() : int
Return values
int

sleep()

Sleep for $seconds.

public sleep(int $seconds) : mixed
Parameters
$seconds : int
Return values
mixed

write()

Called when a message is sent so that the outgoing counter can be increased.

public write(string $bytes) : int
Parameters
$bytes : string
Return values
int

throttleBytesPerMinute()

Get a number of seconds to sleep for.

private throttleBytesPerMinute(int $timePassed) : int
Parameters
$timePassed : int
Return values
int

throttleMessagesPerMinute()

Get a number of seconds to sleep for.

private throttleMessagesPerMinute(int $timePassed) : int
Parameters
$timePassed : int
Return values
int

throttleMessagesPerSecond()

Get a number of seconds to sleep for.

private throttleMessagesPerSecond(int $timePassed) : int
Parameters
$timePassed : int
Return values
int

Search results