rdispatcher.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace queue;
  3. require_once(BASE_HELPER_PATH . '/queue/iqueue.php');
  4. class DispatcherClient extends IClient
  5. {
  6. private static $stInstance = null;
  7. public static function instance()
  8. {
  9. if (self::$stInstance == null) {
  10. self::$stInstance = new DispatcherClient();
  11. }
  12. return self::$stInstance;
  13. }
  14. public function __construct()
  15. {
  16. $db = new DispatcherDB();
  17. parent::__construct($db);
  18. }
  19. }
  20. class DispatcherDB extends IQueueDB
  21. {
  22. public function __construct()
  23. {
  24. parent::__construct('QUEUE_DISPATCHER_CO');
  25. }
  26. }
  27. class DispatcherServer extends IServer
  28. {
  29. public function __construct() {
  30. $queuedb = new DispatcherDB();
  31. parent::__construct($queuedb);
  32. }
  33. }
  34. class CoDispatcherDB extends IQueueDB
  35. {
  36. public function __construct()
  37. {
  38. parent::__construct('QUEUE_DISPATCHER_CO');
  39. }
  40. }
  41. class CoDispatcherServer extends IServer
  42. {
  43. public function __construct() {
  44. $queuedb = new CoDispatcherDB();
  45. parent::__construct($queuedb);
  46. }
  47. }