SwooleTableState
class SwooleTableState
Coordinates multi-step Swoole table row mutations across workers.
Swoole Table does not currently provide full-row compare-and-swap, set-if-absent, or delete-if-current primitives, so cache operations that need atomic read-check-write behavior use striped shared Atomics around tiny critical sections.
Properties
| protected StripedLock | $locks |
Methods
table()
Get the Swoole table.
int
hashSeed()
Get the hash seed.
mixed
withRowLock(string $key, callable $callback)
Run the callback while holding the row lock for the given table key.
mixed
withAllRowLocks(callable $callback)
Run the callback while holding every row-lock stripe.
Details
at line 28
__construct(SwooleTable $table, int $hashSeed = 0)
Create a new Swoole table state instance.
at line 39
SwooleTable
table()
Get the Swoole table.
at line 47
int
hashSeed()
Get the hash seed.
at line 59
mixed
withRowLock(string $key, callable $callback)
Run the callback while holding the row lock for the given table key.
at line 71
mixed
withAllRowLocks(callable $callback)
Run the callback while holding every row-lock stripe.