0

I'm trying to use Swoole context and finally have simplifyed it down to the following code

$server->on("Start", function(Server $server) 
{
    echo "OpenSwoole WebSocket Server is started at http://127.0.0.1:".config('chat_port')."\n";

    Co::getContext()['total'] = 10;
    var_export(Co::getContext()); 
}

var_export prints NULL. Should the context somehow enabled in configuration or somewhere? Can't google it..

zzmaster
  • 318
  • 1
  • 5
  • 16

0 Answers0