ConsumerInterface.php 785 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\MessageQueue;
  7. /**
  8. * Consumers will connect to a queue, read messages, and invoke a method to process the message contents.
  9. *
  10. * @api
  11. * @since 102.0.1
  12. * @since 100.0.2
  13. */
  14. interface ConsumerInterface
  15. {
  16. /**
  17. * Connects to a queue, consumes a message on the queue, and invoke a method to process the message contents.
  18. *
  19. * @param int|null $maxNumberOfMessages if not specified - process all queued incoming messages and terminate,
  20. * otherwise terminate execution after processing the specified number of messages
  21. * @return void
  22. * @since 102.0.1
  23. */
  24. public function process($maxNumberOfMessages = null);
  25. }