Counter

An asynchronous counter that can be used to across the cluster to maintain a consistent count.

package

Default

Methods

__construct

__construct() 

Add the value to the counter atomically and return the new count

addAndGet( $arg0,  $arg1) : void

Arguments

$arg0

integer

$arg1

callable

Set the counter to the specified value only if the current value is the expectec value. This happens atomically.

compareAndSet( $arg0,  $arg1,  $arg2) : void

Arguments

$arg0

integer

$arg1

integer

$arg2

callable

Decrement the counter atomically and return the new count

decrementAndGet( $arg0) : void

Arguments

$arg0

callable

Get the current value of the counter

get( $arg0) : void

Arguments

$arg0

callable

Add the value to the counter atomically and return the value before the add

getAndAdd( $arg0,  $arg1) : void

Arguments

$arg0

integer

$arg1

callable

Increment the counter atomically and return the value before the increment.

getAndIncrement( $arg0) : void

Arguments

$arg0

callable

Increment the counter atomically and return the new count

incrementAndGet( $arg0) : void

Arguments

$arg0

callable