compareAndSet

open suspend override fun compareAndSet(key: String, compareAndSetFunction: (current: BucketState?) -> BucketState)

Set the state of the bucket for the given key.

Parameters

key

the key to use to set the state

compareAndSetFunction

a Compare-And-Set function that takes the current state of the bucket and returns the new state