2025.3.11

This commit is contained in:
2025-03-11 13:34:12 +08:00
commit 0b95eb8bf0
2161 changed files with 219203 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace Webman;
use Workerman\Coroutine\Context as WorkermanContext;
use Workerman\Coroutine\Utils\DestructionWatcher;
use Closure;
/**
* Class Context
* @package Webman
*/
class Context extends WorkermanContext
{
public static function onDestroy(Closure $closure): void
{
$obj = static::get('context.onDestroy');
if (!$obj) {
$obj = new \stdClass();
static::set('context.onDestroy', $obj);
}
DestructionWatcher::watch($obj, $closure);
}
}