Spool.php 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. *
  12. * @package Swift
  13. * @author Fabien Potencier
  14. */
  15. interface Swift_Spool
  16. {
  17. /**
  18. * Starts this Spool mechanism.
  19. */
  20. public function start();
  21. /**
  22. * Stops this Spool mechanism.
  23. */
  24. public function stop();
  25. /**
  26. * Tests if this Spool mechanism has started.
  27. *
  28. * @return boolean
  29. */
  30. public function isStarted();
  31. /**
  32. * Queues a message.
  33. *
  34. * @param Swift_Mime_Message $message The message to store
  35. *
  36. * @return boolean Whether the operation has succeeded
  37. */
  38. public function queueMessage(Swift_Mime_Message $message);
  39. /**
  40. * Sends messages using the given transport instance.
  41. *
  42. * @param Swift_Transport $transport A transport instance
  43. * @param string[] $failedRecipients An array of failures by-reference
  44. *
  45. * @return integer The number of sent emails
  46. */
  47. public function flushQueue(Swift_Transport $transport, &$failedRecipients = null);
  48. }