store

abstract suspend fun store(contextName: String, limit: Long)(source)

Records that numbers below limit may have been used by the context contextName.

  • Durable when it returns: after a crash or power loss right afterwards, load returns at least limit.

  • It may throw or be cancelled. The persisted value is then the previous or the new limit, never a torn or lower one. The context assumes nothing was persisted: it hands out no number at or above the previous limit and writes again on its next use. Its exception reaches the caller unchanged.

  • The limits of one context never decrease; a retry repeats the same value.