Package-level declarations

Types

Link copied to clipboard
class AtomicList<E> : List<E>

A List that allows for thread safe, atomic mutation. Returned collections such as iterator and subList reference a snapshot of when they were accessed, and are not mutated when the list is.

Link copied to clipboard
class AtomicMap<K, V> : Map<K, V>

A Map that allows for thread safe, atomic mutation. Returned collections such as entries and iterator reference a snapshot of when they were accessed, and are not mutated when the map is.

Link copied to clipboard
class AtomicSet<E> : Set<E>

A Set that allows for thread safe, atomic mutation. Returned iterator references a snapshot of when this was accessed, and is not mutated when the set is.

Link copied to clipboard

A MutableMap where all reads and writes are protected by a ReentrantLock.

Functions

Link copied to clipboard

Returns an empty AtomicMap that does not guarantee preservation of iteration order, but may be faster.

fun <K, V> atomicHashMapOf(vararg pairs: Pair<K, V>): AtomicMap<K, V>

Returns an AtomicMap that does not guarantee preservation of iteration order, but may be faster.

Link copied to clipboard

Returns an empty AtomicSet that does not guarantee preservation of iteration order, but may be faster.

fun <E> atomicHashSetOf(vararg elements: E): AtomicSet<E>

Returns an AtomicSet that does not guarantee preservation of iteration order, but may be faster.

Link copied to clipboard

Returns an empty AtomicList.

fun <E> atomicListOf(vararg elements: E): AtomicList<E>

Returns an AtomicList.

Link copied to clipboard
fun <K, V> atomicMapOf(): AtomicMap<K, V>

Returns an empty AtomicMap that guarantees preservation of iteration order, but may be slower.

fun <K, V> atomicMapOf(vararg pairs: Pair<K, V>): AtomicMap<K, V>

Returns an AtomicMap that guarantees preservation of iteration order, but may be slower.

Link copied to clipboard

Returns an empty AtomicSet that guarantees preservation of iteration order, but may be slower.

fun <E> atomicSetOf(vararg elements: E): AtomicSet<E>

Returns an AtomicSet that guarantees preservation of iteration order, but may be slower.

Link copied to clipboard
inline fun <K, V> AtomicMap<K, V>.getOrPut(key: K, defaultValue: () -> V): V

Atomic version of MutableMap.getOrPut. defaultValue can be evaluated multiple times if a concurrent edit occurs.

Link copied to clipboard

Returns an empty new SynchronizedMap.

fun <K, V> synchronizedMapOf(vararg pairs: Pair<K, V>): SynchronizedMap<K, V>

Returns a new SynchronizedMap with the specified contents.

Link copied to clipboard
fun <K, V> Map<K, V>.toJsObject(transform: (Map.Entry<K, V>) -> Pair<String, dynamic>): dynamic

Convert a map to a Plain Old JavaScript Object by transforming the keys to strings and the values to any of the JavaScript types. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#javascript_types