share - scil/LaravelFly GitHub Wiki

share integer vars

see: swoole atomic

  1. create a new integer var

\LaravelFly\Fly::getServer->newIntegerMemory(name, swoole_atomic)

  1. set value

\LaravelFly\Fly::getServer->setIntegerMemory(name, value, when = null)

arg when is used for swoole_atomic->cmpset

  1. add/plus

\LaravelFly\Fly::getServer->addIntegerMemory(name, value)

\LaravelFly\Fly::getServer->subIntegerMemory(name, value)

  1. get value

\LaravelFly\Fly::getServer->getIntegerMemory(name)