12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- require_once(BASE_CORE_PATH . '/framework/function/http.php');
- class processor extends queue\ILooper
- {
- public function __construct()
- {
- parent::__construct(new queue\DispatcherServer());
- }
- protected function handle($msg)
- {
- if (empty($msg)) {
- Log::record('empty body', Log::DEBUG);
- }
- else
- {
- foreach ($msg as $key => $params)
- {
- Log::record("start one", Log::DEBUG);
- if (empty($params)) continue;
- $method = strtolower($key);
- $proxy = new proxy();
- go(function () use ($proxy, $params, $method)
- {
- try
- {
- if ($method == 'add') {
- $proxy->add($params);
- } elseif ($method == 'notify') {
- } elseif ($method == 'notify_mechant') {
- } else {
- Log::record("Error msg", Log::DEBUG);
- }
- } catch (Exception $x) {
- Log::record($x->getMessage(), Log::ERR);
- }
- });
- }
- }
- }
- }
|