|
@@ -0,0 +1,26 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+class Daemon{
|
|
|
+
|
|
|
+ protected $handler = null;
|
|
|
+
|
|
|
+ public function init(){
|
|
|
+ $this->handler = new \Redis();
|
|
|
+ $this->handler->connect('39.97.239.116', 6379);
|
|
|
+ $this->handler->auth('huaxiashangmeng');
|
|
|
+ $this->handler->select(1);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function btoc($listname){
|
|
|
+ $result = $this->handler->BRPOP($listname,0);
|
|
|
+ if($result){
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+$daemon = new Daemon();
|
|
|
+$daemon->init();
|
|
|
+while (true){
|
|
|
+
|
|
|
+}
|