MemorySpool extends AbstractTransport implements SingletonInterface, DelayedTransportInterface uses BlockSerializationTrait
Because TYPO3 doesn't offer a terminate signal or hook, and taking in account the risk that extensions do some redirects or even exit, we simply use the destructor of a singleton class which should be pretty much at the end of a request.
To have only one memory spool per request seems to be more appropriate anyway.
This class is experimental and subject to change!
Table of Contents
Interfaces
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
- DelayedTransportInterface
- Used to implement backwards-compatible spooling
Properties
- $logger : LoggerInterface|null
- The logger instance.
- $queuedMessages : array<string|int, SentMessage>
- $retries : int
- Maximum number of retries when the real transport has failed.
Methods
- __construct() : mixed
- Create a new MemorySpool
- __destruct() : mixed
- Sends out the messages in the memory
- __toString() : string
- __wakeup() : mixed
- Deny object deserialization.
- flushQueue() : int
- Sends messages using the given transport instance
- doSend() : void
- Stores a message in the queue.
Properties
$logger
The logger instance.
protected
LoggerInterface|null
$logger
$queuedMessages
protected
array<string|int, SentMessage>
$queuedMessages
= []
$retries
Maximum number of retries when the real transport has failed.
protected
int
$retries
= 3
Methods
__construct()
Create a new MemorySpool
public
__construct([EventDispatcherInterface $dispatcher = null ][, LoggerInterface $logger = null ]) : mixed
Parameters
- $dispatcher : EventDispatcherInterface = null
- $logger : LoggerInterface = null
__destruct()
Sends out the messages in the memory
public
__destruct() : mixed
__toString()
public
__toString() : string
Return values
string__wakeup()
Deny object deserialization.
public
__wakeup() : mixed
flushQueue()
Sends messages using the given transport instance
public
flushQueue(TransportInterface $transport) : int
Parameters
- $transport : TransportInterface
Tags
Return values
int —the number of messages sent
doSend()
Stores a message in the queue.
protected
doSend(SentMessage $message) : void
Parameters
- $message : SentMessage