Class: ReplicatedRegister

akkaserverless.replicatedentity. ReplicatedRegister

A Replicated Register data type.

A ReplicatedRegister uses a clock to determine which of two concurrent updates should win. The last write wins. The clock is represented as a number. The default clock uses the proxies system time, custom clocks can supply a custom number to be used. If two clock values are equal, the write from the node with the lowest address wins.


new ReplicatedRegister(value [, clock] [, customClockValue])

Parameters:
Name Type Argument Default Description
value module:akkaserverless.Serializable

A value to hold in the register.

clock module:akkaserverless.replicatedentity.Clock <optional>
Clocks.DEFAULT

The clock to use.

customClockValue number <optional>
0

The custom clock value, if using a custom clock.

Implements:

Members


value :module:akkaserverless.Serializable

The value of this register.

Setting it will cause it to be set with the default clock.

Type:

Methods


setWithClock(value [, clock] [, customClockValue])

Set the value using a custom clock.

Parameters:
Name Type Argument Default Description
value module:akkaserverless.Serializable

The value to set.

clock module:akkaserverless.replicatedentity.Clock <optional>
Clocks.DEFAULT

The clock.

customClockValue number <optional>
0

Ignored if a custom clock isn't specified.