QueueInterface.php 575 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Jenner
  5. * Date: 2015/8/12
  6. * Time: 15:11
  7. */
  8. namespace Jenner\SimpleFork\Queue;
  9. /**
  10. * queue for processes to transfer data
  11. *
  12. * @package Jenner\SimpleFork\Queue
  13. */
  14. interface QueueInterface
  15. {
  16. /**
  17. * put value into the queue of channel
  18. *
  19. * @param $value
  20. * @return bool
  21. */
  22. public function put($value);
  23. /**
  24. * get value from the queue of channel
  25. *
  26. * @param bool $block if block when the queue is empty
  27. * @return bool|string
  28. */
  29. public function get($block = false);
  30. }