Class Swift_FileSpool

InheritanceSwift_FileSpool » Swift_ConfigurableSpool
ImplementsSwift_Spool

Stores Messages on the filesystem.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Create a new FileSpool. Swift_FileSpool
flushQueue() Sends messages using the given transport instance. Swift_FileSpool
getMessageLimit() Gets the maximum number of messages to send per flush. Swift_ConfigurableSpool
getTimeLimit() Gets the time limit (in seconds) per flush. Swift_ConfigurableSpool
isStarted() Tests if this Spool mechanism has started. Swift_FileSpool
queueMessage() Queues a message. Swift_FileSpool
recover() Execute a recovery if for any reason a process is sending for too long. Swift_FileSpool
setMessageLimit() Sets the maximum number of messages to send per flush. Swift_ConfigurableSpool
setRetryLimit() Allow to manage the enqueuing retry limit. Swift_FileSpool
setTimeLimit() Sets the time limit (in seconds) per flush. Swift_ConfigurableSpool
start() Starts this Spool mechanism. Swift_FileSpool
stop() Stops this Spool mechanism. Swift_FileSpool

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getRandomString() Returns a random string needed to generate a fileName for the queue. Swift_FileSpool

Method Details

__construct() public method

Create a new FileSpool.

public void __construct ( $path )
$path string
throws Swift_IoException
flushQueue() public method

Sends messages using the given transport instance.

public int flushQueue ( Swift_Transport $transport, &$failedRecipients null )
$transport Swift_Transport

A transport instance

$failedRecipients string[]

An array of failures by-reference

return int

The number of sent e-mail's

getRandomString() protected method

Returns a random string needed to generate a fileName for the queue.

protected string getRandomString ( $count )
$count int
isStarted() public method

Tests if this Spool mechanism has started.

public bool isStarted ( )
queueMessage() public method

Queues a message.

public bool queueMessage ( Swift_Mime_Message $message )
$message Swift_Mime_Message

The message to store

throws Swift_IoException
recover() public method

Execute a recovery if for any reason a process is sending for too long.

public void recover ( $timeout 900 )
$timeout int

In second Defaults is for very slow smtp responses

setRetryLimit() public method

Allow to manage the enqueuing retry limit.

Default, is ten and allows over 64^20 different fileNames

public void setRetryLimit ( $limit )
$limit int
start() public method

Starts this Spool mechanism.

public void start ( )
stop() public method

Stops this Spool mechanism.

public void stop ( )