public function postTask(Worker $worker, array $options = null)
{
if ($worker instanceof MailerAwareWorker) {
if ($this->mailer && $this->transport) {
//Flush the mailer queue, this isn't normally done until the command execution finishes
$this->mailer->getTransport()->getSpool()->flushQueue($this->transport);
$this->transport->stop();
$this->logger->info('Flushed mail queue');
}
}
}