|
@@ -0,0 +1,28 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace Queue\Src;
|
|
|
+
|
|
|
+use Dever;
|
|
|
+
|
|
|
+class Queue
|
|
|
+{
|
|
|
+ private $method;
|
|
|
+
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ $method = 'Queue\\Src\\' . ucfirst(Dever::config('base')->queue['method']);
|
|
|
+ $this->method = new $method();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function push($value)
|
|
|
+ {
|
|
|
+ $value = json_encode($value);
|
|
|
+ $this->method->push($value);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function pop()
|
|
|
+ {
|
|
|
+ $data = $this->method->pop();
|
|
|
+ return json_decode($data, true);
|
|
|
+ }
|
|
|
+}
|