改名
This commit is contained in:
@@ -25,6 +25,9 @@ class OnWorkerExit extends Callback
|
|||||||
{
|
{
|
||||||
putenv('state=exit');
|
putenv('state=exit');
|
||||||
|
|
||||||
|
$channel = Snowflake::app()->getChannel();
|
||||||
|
$channel->cleanAll();
|
||||||
|
|
||||||
$event = Snowflake::app()->getEvent();
|
$event = Snowflake::app()->getEvent();
|
||||||
$event->trigger(Event::SERVER_WORKER_EXIT);
|
$event->trigger(Event::SERVER_WORKER_EXIT);
|
||||||
$event->offName(Event::SERVER_WORKER_EXIT);
|
$event->offName(Event::SERVER_WORKER_EXIT);
|
||||||
|
|||||||
@@ -68,6 +68,19 @@ class Channel extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 清空缓存
|
||||||
|
*/
|
||||||
|
public function cleanAll()
|
||||||
|
{
|
||||||
|
/** @var CChannel $channel */
|
||||||
|
foreach ($this->_channels as $channel) {
|
||||||
|
$channel->close();
|
||||||
|
}
|
||||||
|
$this->_channels = [];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $timeout
|
* @param $timeout
|
||||||
* @param Closure $closure
|
* @param Closure $closure
|
||||||
|
|||||||
Reference in New Issue
Block a user