insertAfter

fun insertAfter(replica: ReplicaId, after: RgaId, value: V): Pair<Rga<V>, RgaOp.Insert<V>>

Insert value immediately after the element with after id, minting a new RgaId on behalf of replica.

Returns the new Rga state and the RgaOp.Insert op to broadcast.

Throws

if the Lamport clock or replica's seq is already at Long.MAX_VALUE, as a decoded op-log or a peer's op can leave it (#3417). The next value would wrap to Long.MIN_VALUE, the Lamport time of RgaId.HEAD.