Spool.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /*
  3. * This file is part of SwiftMailer.
  4. * (c) 2009 Fabien Potencier <fabien.potencier@gmail.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * Interface for spools.
  11. * @package Swift
  12. * @author Fabien Potencier
  13. */
  14. interface Swift_Spool
  15. {
  16. /**
  17. * Starts this Spool mechanism.
  18. */
  19. public function start();
  20. /**
  21. * Stops this Spool mechanism.
  22. */
  23. public function stop();
  24. /**
  25. * Tests if this Spool mechanism has started.
  26. *
  27. * @return boolean
  28. */
  29. public function isStarted();
  30. /**
  31. * Queues a message.
  32. * @param Swift_Mime_Message $message The message to store
  33. */
  34. public function queueMessage(Swift_Mime_Message $message);
  35. /**
  36. * Sends messages using the given transport instance.
  37. *
  38. * @param Swift_Transport $transport A transport instance
  39. * @param string[] &$failedRecipients An array of failures by-reference
  40. *
  41. * @return int The number of sent emails
  42. */
  43. public function flushQueue(Swift_Transport $transport, &$failedRecipients = null);
  44. }