FileSpool extends AbstractTransport implements DelayedTransportInterface

Inspired by SwiftMailer, adapted for TYPO3 and Symfony/Mailer

Internal

This class is experimental and subject to change!

Table of Contents

Interfaces

DelayedTransportInterface
Used to implement backwards-compatible spooling

Properties

$logger  : LoggerInterface|null
$messageLimit  : int
The maximum number of messages to send per flush
$path  : string
$retryLimit  : int
File WriteRetry Limit.
$timeLimit  : int
The time limit per flush

Methods

__construct()  : mixed
Create a new FileSpool, storing messages in $path.
__toString()  : string
flushQueue()  : int
Sends messages using the given transport instance
getMessageLimit()  : int
Gets the maximum number of messages to send per flush.
getTimeLimit()  : int
Gets the time limit (in seconds) per flush.
recover()  : void
Execute a recovery if for any reason a process is sending for too long.
setMessageLimit()  : void
Sets the maximum number of messages to send per flush.
setRetryLimit()  : void
Allow to manage the enqueuing retry limit.
setTimeLimit()  : void
Sets the time limit (in seconds) per flush.
doSend()  : void
Stores a message in the queue.
getRandomString()  : string
Returns a random string needed to generate a fileName for the queue.

Properties

$logger read-only

protected LoggerInterface|null $logger = null

$messageLimit

The maximum number of messages to send per flush

protected int $messageLimit

$retryLimit

File WriteRetry Limit.

protected int $retryLimit = 10

$timeLimit

The time limit per flush

protected int $timeLimit

Methods

__construct()

Create a new FileSpool, storing messages in $path.

public __construct(string $path[, EventDispatcherInterface|null $dispatcher = null ][, LoggerInterface|null $logger = null ]) : mixed
Parameters
$path : string
$dispatcher : EventDispatcherInterface|null = null
$logger : LoggerInterface|null = null

__toString()

public __toString() : string
Return values
string

flushQueue()

Sends messages using the given transport instance

public flushQueue(TransportInterface $transport) : int
Parameters
$transport : TransportInterface
Return values
int

the number of messages sent

getMessageLimit()

Gets the maximum number of messages to send per flush.

public getMessageLimit() : int
Return values
int

getTimeLimit()

Gets the time limit (in seconds) per flush.

public getTimeLimit() : int
Return values
int

recover()

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

public recover([int $timeout = 900 ]) : void
Parameters
$timeout : int = 900

in second Defaults is for very slow smtp responses

setMessageLimit()

Sets the maximum number of messages to send per flush.

public setMessageLimit(int $limit) : void
Parameters
$limit : int

setRetryLimit()

Allow to manage the enqueuing retry limit.

public setRetryLimit(int $limit) : void

Default is ten and allows over 64^20 different fileNames

Parameters
$limit : int

setTimeLimit()

Sets the time limit (in seconds) per flush.

public setTimeLimit(int $limit) : void
Parameters
$limit : int

doSend()

Stores a message in the queue.

protected doSend(SentMessage $message) : void
Parameters
$message : SentMessage

getRandomString()

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

protected getRandomString(int $count) : string
Parameters
$count : int
Return values
string

        
On this page

Search results