Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.
scil edited this page Aug 20, 2018 · 4 revisions

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)