for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Hhxsv5\LaravelS\Swoole\Coroutine;
use Swoole\Coroutine;
class Context
{
protected static $box = [];
public static function get($key)
$uid = Coroutine::getuid();
if ($uid < 0) {
return null;
}
if (isset(self::$box[$uid][$key])) {
return self::$box[$uid][$key];
public static function put($key, $item)
if ($uid > 0) {
self::$box[$uid][$key] = $item;
public static function delete($key = null)
if ($key) {
unset(self::$box[$uid][$key]);
} else {
unset(self::$box[$uid]);