FileSpool extends AbstractTransport implements DelayedTransportInterface
Inspired by SwiftMailer, adapted for TYPO3 and Symfony/Mailer
This class is experimental and subject to change!
Table of Contents
Interfaces
- DelayedTransportInterface
- Used to implement backwards-compatible spooling
Properties
- $logger : LoggerInterface|null
- The logger instance.
- $messageLimit : int
- The maximum number of messages to send per flush
- $path : string
- The spool directory
- $retryLimit : int
- File WriteRetry Limit.
- $timeLimit : int
- The time limit per flush
Methods
- __construct() : mixed
- Create a new FileSpool.
- __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
The logger instance.
        protected
            LoggerInterface|null
    $logger
    
    
    
    
    
    
$messageLimit
The maximum number of messages to send per flush
        protected
            int
    $messageLimit
    
    
    
    
    
    
$path
The spool directory
        protected
            string
    $path
    
    
    
    
    
    
$retryLimit
File WriteRetry Limit.
        protected
            int
    $retryLimit
     = 10
    
    
    
    
    
$timeLimit
The time limit per flush
        protected
            int
    $timeLimit
    
    
    
    
    
    
Methods
__construct()
Create a new FileSpool.
    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
stringflushQueue()
Sends messages using the given transport instance
    public
                    flushQueue(TransportInterface $transport) : int
    Parameters
- $transport : TransportInterface
Tags
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 —The limit
getTimeLimit()
Gets the time limit (in seconds) per flush.
    public
                    getTimeLimit() : int
    Return values
int —The limit
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
- 
                    The limit 
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