TYPO3  7.6
Public Member Functions | Private Attributes | List of all members
Swift_Plugins_BandwidthMonitorPlugin Class Reference
Inheritance diagram for Swift_Plugins_BandwidthMonitorPlugin:
Swift_Events_SendListener Swift_Events_CommandListener Swift_Events_ResponseListener Swift_InputByteStream Swift_Events_EventListener Swift_Events_EventListener Swift_Events_EventListener Swift_Plugins_ThrottlerPlugin

Public Member Functions

 beforeSendPerformed (Swift_Events_SendEvent $evt)
 
 sendPerformed (Swift_Events_SendEvent $evt)
 
 commandSent (Swift_Events_CommandEvent $evt)
 
 responseReceived (Swift_Events_ResponseEvent $evt)
 
 write ($bytes)
 
 commit ()
 
 bind (Swift_InputByteStream $is)
 
 unbind (Swift_InputByteStream $is)
 
 flushBuffers ()
 
 getBytesOut ()
 
 getBytesIn ()
 
 reset ()
 

Private Attributes

 $_out = 0
 
 $_in = 0
 
 $_mirrors = array()
 

Detailed Description

Reduces network flooding when sending large amounts of mail.

Author
Chris Corbyn

Definition at line 16 of file BandwidthMonitorPlugin.php.

Member Function Documentation

beforeSendPerformed ( Swift_Events_SendEvent  $evt)

Not used.

Implements Swift_Events_SendListener.

Definition at line 38 of file BandwidthMonitorPlugin.php.

bind ( Swift_InputByteStream  $is)

Attach $is to this stream.

The stream acts as an observer, receiving all data that is written. All write() and flushBuffers() operations will be mirrored.

Parameters
Swift_InputByteStream$is

Implements Swift_InputByteStream.

Definition at line 103 of file BandwidthMonitorPlugin.php.

commandSent ( Swift_Events_CommandEvent  $evt)

Invoked immediately following a command being sent.

Parameters
Swift_Events_CommandEvent$evt

Implements Swift_Events_CommandListener.

Definition at line 58 of file BandwidthMonitorPlugin.php.

References Swift_Events_CommandEvent\getCommand().

commit ( )

Not used.

Implements Swift_InputByteStream.

Definition at line 91 of file BandwidthMonitorPlugin.php.

flushBuffers ( )

Not used.

Implements Swift_InputByteStream.

Definition at line 129 of file BandwidthMonitorPlugin.php.

getBytesIn ( )

Get the total number of bytes received from the server.

Returns
int

Definition at line 151 of file BandwidthMonitorPlugin.php.

References $_in.

getBytesOut ( )

Get the total number of bytes sent to the server.

Returns
int

Definition at line 141 of file BandwidthMonitorPlugin.php.

References $_out.

Referenced by Swift_Plugins_ThrottlerPlugin\_throttleBytesPerMinute().

reset ( )

Reset the internal counters to zero.

Definition at line 159 of file BandwidthMonitorPlugin.php.

responseReceived ( Swift_Events_ResponseEvent  $evt)

Invoked immediately following a response coming back.

Parameters
Swift_Events_ResponseEvent$evt

Implements Swift_Events_ResponseListener.

Definition at line 69 of file BandwidthMonitorPlugin.php.

References $response, and Swift_Events_ResponseEvent\getResponse().

sendPerformed ( Swift_Events_SendEvent  $evt)

Invoked immediately after the Message is sent.

Parameters
Swift_Events_SendEvent$evt

Implements Swift_Events_SendListener.

Definition at line 47 of file BandwidthMonitorPlugin.php.

References Swift_Events_SendEvent\getMessage().

unbind ( Swift_InputByteStream  $is)

Remove an already bound stream.

If $is is not bound, no errors will be raised. If the stream currently has any buffered data it will be written to $is before unbinding occurs.

Parameters
Swift_InputByteStream$is

Implements Swift_InputByteStream.

Definition at line 117 of file BandwidthMonitorPlugin.php.

write (   $bytes)

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

Parameters
string$bytes

Implements Swift_InputByteStream.

Definition at line 80 of file BandwidthMonitorPlugin.php.

Member Data Documentation

$_in = 0
private

Definition at line 30 of file BandwidthMonitorPlugin.php.

Referenced by getBytesIn().

$_mirrors = array()
private

Bound byte streams

Definition at line 33 of file BandwidthMonitorPlugin.php.

$_out = 0
private

Definition at line 23 of file BandwidthMonitorPlugin.php.

Referenced by getBytesOut().