PreparedValue

interface PreparedValue<V>

Interface representing a value that has been prepared with optional time-to-live (TTL) support. Prepared values can either be permanent (never expire) or temporary (expire after a certain time).

This interface is used in conjunction with PrepareKey to provide TTL-based key reservations in EventSourcing architectures where uniqueness constraints need to be enforced.

Parameters

V

the type of the prepared value

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val isExpired: Boolean

Checks if this prepared value has expired. Permanent values (isForever = true) never expire. Temporary values expire when the current time exceeds ttlAt.

Link copied to clipboard
open val isForever: Boolean

Checks if this prepared value is permanent (never expires). A value is considered permanent if its ttlAt is greater than or equal to TTL_FOREVER.

Link copied to clipboard
abstract val ttlAt: Long

The timestamp (in milliseconds since epoch) when this prepared value expires. Values with ttlAt >= TTL_FOREVER are considered permanent and never expire.

Link copied to clipboard
abstract val value: V

The actual value being prepared.