nonAndroidJvmMain.com.caesarealabs.rpc4k.runtime.platform.ConcurrentCollections.jvm.kt Maven / Gradle / Ivy
package com.caesarealabs.rpc4k.runtime.platform
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.ConcurrentLinkedQueue
/**
* Creates a [MutableMap] that is safe to edit in multiple threads at the same time
*/
public actual fun ConcurrentMutableMap(): MutableMap = ConcurrentHashMap()
/**
* Creates a [MutableCollection] that is safe to edit in multiple threads at the same time.
* This is intended to be used as a queue because the most performant implementation is a queue. (In regards to time complexity)
*/
public actual fun ConcurrentQueue(): MutableCollection = ConcurrentLinkedQueue()