share - scil/LaravelFly GitHub Wiki
share integer vars
see: swoole atomic
- create a new integer var
\LaravelFly\Fly::getServer->newIntegerMemory(name, swoole_atomic)
- set value
\LaravelFly\Fly::getServer->setIntegerMemory(name, value, when = null)
arg when is used for swoole_atomic->cmpset
- add/plus
\LaravelFly\Fly::getServer->addIntegerMemory(name, value)
\LaravelFly\Fly::getServer->subIntegerMemory(name, value)
- get value
\LaravelFly\Fly::getServer->getIntegerMemory(name)