Package-level declarations
Types
Link copied to clipboard
object ConcurrencyUtils
Concurrency utilities for state management without external dependencies.
Link copied to clipboard
Thread-safe wrapper for StateContainer implementations.
Functions
Link copied to clipboard
Conditionally updates the state only if the current state matches the expected state.
Link copied to clipboard
Updates the state and returns the previous state if successful, or null if failed.
Link copied to clipboard
Returns the current state cast to the specified type, or null if not of that type.
Link copied to clipboard
Returns true if the current state is of the specified type.
Link copied to clipboard
Updates the state and returns the new state if successful, or null if failed.
Link copied to clipboard
fun <T> StateContainer<T>.updateAtomic(maxRetries: Int = 10, updater: (T) -> T): StateUpdateResult<T>
Extension function for StateContainer to perform atomic updates.
Link copied to clipboard
Transforms the state using a suspending function while maintaining thread safety.