Spool.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. * @return boolean Whether the operation has succeeded
  35. */
  36. public function queueMessage(Swift_Mime_Message $message);
  37. /**
  38. * Sends messages using the given transport instance.
  39. *
  40. * @param Swift_Transport $transport A transport instance
  41. * @param string[] &$failedRecipients An array of failures by-reference
  42. *
  43. * @return int The number of sent emails
  44. */
  45. public function flushQueue(Swift_Transport $transport, &$failedRecipients = null);
  46. }