Browse Source

平滑更新预留接口

master
Mike 5 years ago
parent
commit
77e7c239b4
  1. 32
      app/Listener/LanzuServerStartListener.php
  2. 1
      config/autoload/listeners.php

32
app/Listener/LanzuServerStartListener.php

@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://doc.hyperf.io
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace App\Listener;
use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Framework\Event\MainWorkerStart;
class LanzuServerStartListener implements ListenerInterface
{
public function listen(): array
{
return [
MainWorkerStart::class,
];
}
public function process(object $event)
{
//平滑更新
//var_dump("process:\n");
}
}

1
config/autoload/listeners.php

@ -11,4 +11,5 @@ declare(strict_types=1);
*/ */
return [ return [
\App\Listener\ValidatorFactoryResolvedListener::class, \App\Listener\ValidatorFactoryResolvedListener::class,
\App\Listener\LanzuServerStartListener::class,
]; ];
Loading…
Cancel
Save