put

abstract suspend fun put(key: String, creationFunction: suspend (C) -> Boolean): C?

Associates a new container serialized by creationFunction with the given key.

This function waits for the creation to complete. If the creation fails, the function returns null. Any unhandled exceptions inside the creation block will be thrown. Existing or under-creation containers associated with key will be replaced by the new container.

creationFunction should return true if the creation was successful, and false otherwise.