MBaseTopicQueue.Class.php 931 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace Jobs\Model\Queue;
  3. use Jobs\Model\Queue\MTopicQueueInterface;
  4. abstract class MBaseTopicQueue implements MTopicQueueInterface
  5. {
  6. //队列优先级
  7. const HIGH_LEVEL_1=1;
  8. const HIGH_LEVEL_2=2;
  9. const HIGH_LEVEL_3=3;
  10. const HIGH_LEVEL_4=4;
  11. const HIGH_LEVEL_5=5;
  12. public $topics = [];
  13. public $queue = null;
  14. public static function getConnection(array $config, $logger)
  15. {
  16. }
  17. public function getTopics()
  18. {
  19. //根据key大到小排序,并保持索引关系
  20. arsort($this->topics);
  21. return array_values($this->topics);
  22. }
  23. public function setTopics(array $topics)
  24. {
  25. $this->topics = $topics;
  26. }
  27. public function push($topic, $job)
  28. {
  29. }
  30. public function pop($topic)
  31. {
  32. }
  33. public function len($topic)
  34. {
  35. }
  36. public function close()
  37. {
  38. }
  39. public function isConnected()
  40. {
  41. }
  42. }